mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 8/8] staging: vt6656: implement missing brackets
@ 2010-10-28 20:02 Vasiliy Kulikov
  0 siblings, 0 replies; only message in thread
From: Vasiliy Kulikov @ 2010-10-28 20:02 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Andres More, David S. Miller, Jiri Pirko,
	Shawn Bohrer, devel, linux-kernel

Identation says that copy_to_user() should be called only iff
wrq->u.essid.pointer is not zero.  Also it is useless to call copy_to_user(0, ...).

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 drivers/staging/vt6656/main_usb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index e992d5d..7cc3d24 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -1675,13 +1675,14 @@ static int  device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
 
 		{
 			char essid[IW_ESSID_MAX_SIZE+1];
-			if (wrq->u.essid.pointer)
+			if (wrq->u.essid.pointer) {
 				rc = iwctl_giwessid(dev, NULL,
 						    &(wrq->u.essid), essid);
 				if (copy_to_user(wrq->u.essid.pointer,
 						         essid,
 						         wrq->u.essid.length) )
 					rc = -EFAULT;
+			}
 		}
 		break;
 
-- 
1.7.0.4


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

only message in thread, other threads:[~2010-10-28 20:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-28 20:02 [PATCH 8/8] staging: vt6656: implement missing brackets Vasiliy Kulikov

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