diff options
author | Salah Triki <salah.triki@acm.org> | 2016-05-04 04:42:45 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-18 19:49:02 -0700 |
commit | ba15f657cec028ac375c5ca3f901719b46a55cbd (patch) | |
tree | 0a0d15b0d299ee1a069f66d3c4572250d9abcccc /drivers/staging/rtl8192u/r8192U_core.c | |
parent | 4dc2abb852ca447ee5f6836ed410676ee0447c33 (diff) |
staging: rtl8192u: propagate errors in write_nic_byte
Propagate errors from kzalloc and usb_control_msg and change the
return type of write_nic_byte from void to int.
Signed-off-by: Salah Triki <salah.triki@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/r8192U_core.c')
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 74cf9e710ece..30c87c29e661 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -299,7 +299,7 @@ int read_nic_byte_E(struct net_device *dev, int indx, u8 *data) } /* as 92U has extend page from 4 to 16, so modify functions below. */ -void write_nic_byte(struct net_device *dev, int indx, u8 data) +int write_nic_byte(struct net_device *dev, int indx, u8 data) { int status; @@ -308,7 +308,7 @@ void write_nic_byte(struct net_device *dev, int indx, u8 data) u8 *usbdata = kzalloc(sizeof(data), GFP_KERNEL); if (!usbdata) - return; + return -ENOMEM; *usbdata = data; status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), @@ -317,8 +317,12 @@ void write_nic_byte(struct net_device *dev, int indx, u8 data) usbdata, 1, HZ / 2); kfree(usbdata); - if (status < 0) + if (status < 0) { netdev_err(dev, "write_nic_byte TimeOut! status: %d\n", status); + return status; + } + + return 0; } |