Commit 2c09ded5 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: bugfix for fullmac return codes

Some code paths in the fullmac driver did not return a negative value
on error. This has been corrected.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b7ef2a95
...@@ -432,7 +432,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen) ...@@ -432,7 +432,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
case DHD_GET_VERSION: case DHD_GET_VERSION:
if (buflen < sizeof(int)) if (buflen < sizeof(int))
bcmerror = BCME_BUFTOOSHORT; bcmerror = -BCME_BUFTOOSHORT;
else else
*(int *)buf = DHD_IOCTL_VERSION; *(int *)buf = DHD_IOCTL_VERSION;
break; break;
......
...@@ -1699,7 +1699,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd) ...@@ -1699,7 +1699,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
/* Copy the ioc control structure part of ioctl request */ /* Copy the ioc control structure part of ioctl request */
if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) { if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
bcmerror = BCME_BADADDR; bcmerror = -BCME_BADADDR;
goto done; goto done;
} }
...@@ -1715,11 +1715,11 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd) ...@@ -1715,11 +1715,11 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
{ {
buf = kmalloc(buflen, GFP_ATOMIC); buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) { if (!buf) {
bcmerror = BCME_NOMEM; bcmerror = -BCME_NOMEM;
goto done; goto done;
} }
if (copy_from_user(buf, ioc.buf, buflen)) { if (copy_from_user(buf, ioc.buf, buflen)) {
bcmerror = BCME_BADADDR; bcmerror = -BCME_BADADDR;
goto done; goto done;
} }
} }
...@@ -1728,12 +1728,12 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd) ...@@ -1728,12 +1728,12 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
/* To differentiate between wl and dhd read 4 more byes */ /* To differentiate between wl and dhd read 4 more byes */
if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t), if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
sizeof(uint)) != 0)) { sizeof(uint)) != 0)) {
bcmerror = BCME_BADADDR; bcmerror = -BCME_BADADDR;
goto done; goto done;
} }
if (!capable(CAP_NET_ADMIN)) { if (!capable(CAP_NET_ADMIN)) {
bcmerror = BCME_EPERM; bcmerror = -BCME_EPERM;
goto done; goto done;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment