public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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