mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: dgrp: fix potential NULL defereference issue
@ 2012-10-29  5:50 Yuanhan Liu
  0 siblings, 0 replies; only message in thread
From: Yuanhan Liu @ 2012-10-29  5:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: Yuanhan Liu, Fengguang Wu, Julia Lawall, Greg Kroah-Hartman

Fix a coccinelle warning catched by Fengguang's 0-DAY system:
+ drivers/staging/dgrp/dgrp_net_ops.c:1061:11-27: ERROR: nd is NULL but dereferenced.

Put the "done:" label a bit down would solve this issue.

Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/staging/dgrp/dgrp_net_ops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/dgrp/dgrp_net_ops.c b/drivers/staging/dgrp/dgrp_net_ops.c
index ab839ea..1ad674f1 100644
--- a/drivers/staging/dgrp/dgrp_net_ops.c
+++ b/drivers/staging/dgrp/dgrp_net_ops.c
@@ -1057,13 +1057,13 @@ static int dgrp_net_release(struct inode *inode, struct file *file)
 
 	spin_unlock_irqrestore(&dgrp_poll_data.poll_lock, lock_flags);
 
-done:
 	down(&nd->nd_net_semaphore);
 
 	dgrp_monitor_message(nd, "Net Close");
 
 	up(&nd->nd_net_semaphore);
 
+done:
 	module_put(THIS_MODULE);
 	file->private_data = NULL;
 	return 0;
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-29  5:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29  5:50 [PATCH] staging: dgrp: fix potential NULL defereference issue Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome