* [PATCH] staging: ozwpan: ozproto.c: Fix for possible null pointer dereference
@ 2014-05-20 21:28 Rickard Strandqvist
2014-05-20 21:48 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-05-20 21:28 UTC (permalink / raw)
To: Rupesh Gujare, Greg Kroah-Hartman
Cc: Rickard Strandqvist, devel, linux-kernel
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/staging/ozwpan/ozproto.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/ozwpan/ozproto.c b/drivers/staging/ozwpan/ozproto.c
index f09acd0..158e0d2 100644
--- a/drivers/staging/ozwpan/ozproto.c
+++ b/drivers/staging/ozwpan/ozproto.c
@@ -765,7 +765,10 @@ static char *oz_get_next_device_name(char *s, char *dname, int max_size)
int oz_protocol_init(char *devs)
{
skb_queue_head_init(&g_rx_queue);
- if (devs && (devs[0] == '*')) {
+ if (!devs) {
+ return 0;
+ }
+ if (devs[0] == '*') {
oz_binding_add(NULL);
} else {
char d[32];
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: ozwpan: ozproto.c: Fix for possible null pointer dereference
2014-05-20 21:28 [PATCH] staging: ozwpan: ozproto.c: Fix for possible null pointer dereference Rickard Strandqvist
@ 2014-05-20 21:48 ` Dan Carpenter
2014-05-21 0:31 ` DaeSeok Youn
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2014-05-20 21:48 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Rupesh Gujare, Greg Kroah-Hartman, devel, linux-kernel
On Tue, May 20, 2014 at 11:28:59PM +0200, Rickard Strandqvist wrote:
> There is otherwise a risk of a possible null pointer dereference.
>
> Was largely found by using a static code analysis program called cppcheck.
>
This is the empty string by default, or a module parameter. I have
looked at param_set_charp() and I don't think a string module parameter
can be a NULL pointer.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: ozwpan: ozproto.c: Fix for possible null pointer dereference
2014-05-20 21:48 ` Dan Carpenter
@ 2014-05-21 0:31 ` DaeSeok Youn
0 siblings, 0 replies; 3+ messages in thread
From: DaeSeok Youn @ 2014-05-21 0:31 UTC (permalink / raw)
To: Dan Carpenter, Rickard Strandqvist
Cc: Rupesh Gujare, Greg Kroah-Hartman, devel, linux-kernel
I was already sent for this. :-)
https://lkml.org/lkml/2014/5/16/114
Regards,
Daeseok Youn.
2014-05-21 6:48 GMT+09:00 Dan Carpenter <dan.carpenter@oracle.com>:
> On Tue, May 20, 2014 at 11:28:59PM +0200, Rickard Strandqvist wrote:
>> There is otherwise a risk of a possible null pointer dereference.
>>
>> Was largely found by using a static code analysis program called cppcheck.
>>
>
> This is the empty string by default, or a module parameter. I have
> looked at param_set_charp() and I don't think a string module parameter
> can be a NULL pointer.
>
> regards,
> dan carpenter
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-21 0:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20 21:28 [PATCH] staging: ozwpan: ozproto.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-05-20 21:48 ` Dan Carpenter
2014-05-21 0:31 ` DaeSeok Youn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox