Skip to content

Commit

Permalink
staging: dgrp: fix potential NULL defereference issue
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Yuanhan Liu authored and Greg Kroah-Hartman committed Oct 29, 2012
1 parent f71ccaa commit 7defac3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/dgrp/dgrp_net_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7defac3

Please sign in to comment.