]> err.no Git - linux-2.6/commitdiff
[PATCH] libertas: correct error report paths for wlan_fwt_list_ioctl
authorDan Williams <dcbw@redhat.com>
Sat, 26 May 2007 01:59:29 +0000 (21:59 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:43 +0000 (14:28 -0400)
Ensure the leave debug print gets triggered when necessary.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/ioctl.c

index cfb4752b3bce116059f40f52e7d84b7304908d35..a59d26ba6c70828b169d4f341ec13c5c8cf1c696 100644 (file)
@@ -603,12 +603,14 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
        char *ptr = in_str;
        static char out_str[128];
        char *pbuf = out_str;
-       int ret;
+       int ret = 0;
 
        lbs_deb_enter(LBS_DEB_IOCTL);
 
-       if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
-               return -EFAULT;
+       if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) {
+               ret = -EFAULT;
+               goto out;
+       }
 
        fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
 
@@ -632,11 +634,15 @@ static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
        if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
                         wrq->u.data.length)) {
                lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n");
-               return -EFAULT;
+               ret = -EFAULT;
+               goto out;
        }
 
+       ret = 0;
+
+out:
        lbs_deb_leave(LBS_DEB_IOCTL);
-       return 0;
+       return ret;
 }
 
 /**