From: Yuanhan Liu Date: Mon, 29 Oct 2012 05:50:37 +0000 (+0800) Subject: staging: dgrp: fix potential NULL defereference issue X-Git-Tag: next-20121030~23^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7defac36db43df73feef44e0f6edc298868ae1ac;p=karo-tx-linux.git staging: dgrp: fix potential NULL defereference issue 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 Cc: Julia Lawall Cc: Greg Kroah-Hartman Signed-off-by: Yuanhan Liu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgrp/dgrp_net_ops.c b/drivers/staging/dgrp/dgrp_net_ops.c index 067d97555446..c409cd03e8c1 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;