diff options
author | Salah Triki <salah.triki@acm.org> | 2016-05-04 06:42:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-19 05:49:02 +0300 |
commit | 28d653d7d17e774afa375b08fb55c4c0e22795ea (patch) | |
tree | 026620e946de8ebb3785858dcd4c3ea7b23031bd /drivers/staging/rtl8192u | |
parent | 6ae4e4b3028b277ab9bcf776bcbe4db8681af317 (diff) | |
download | linux-28d653d7d17e774afa375b08fb55c4c0e22795ea.tar.xz |
staging: rtl8192u: propagate errors in write_nic_word
Propagate errors from kzalloc and usb_control_msg and change the
return type of write_nic_word 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')
-rw-r--r-- | drivers/staging/rtl8192u/r8192U.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index e0abcf571d8f..27f9aa50943a 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -1131,7 +1131,7 @@ int read_nic_dword(struct net_device *dev, int x, u32 *data); int read_nic_word(struct net_device *dev, int x, u16 *data); int write_nic_byte(struct net_device *dev, int x, u8 y); int write_nic_byte_E(struct net_device *dev, int x, u8 y); -void write_nic_word(struct net_device *dev, int x, u16 y); +int write_nic_word(struct net_device *dev, int x, u16 y); void write_nic_dword(struct net_device *dev, int x, u32 y); void force_pci_posting(struct net_device *dev); diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 675e898d52ce..10eeb1c7ce83 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -329,7 +329,7 @@ int write_nic_byte(struct net_device *dev, int indx, u8 data) } -void write_nic_word(struct net_device *dev, int indx, u16 data) +int write_nic_word(struct net_device *dev, int indx, u16 data) { int status; @@ -338,7 +338,7 @@ void write_nic_word(struct net_device *dev, int indx, u16 data) u16 *usbdata = kzalloc(sizeof(data), GFP_KERNEL); if (!usbdata) - return; + return -ENOMEM; *usbdata = data; status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), @@ -347,8 +347,12 @@ void write_nic_word(struct net_device *dev, int indx, u16 data) usbdata, 2, HZ / 2); kfree(usbdata); - if (status < 0) + if (status < 0) { netdev_err(dev, "write_nic_word TimeOut! status: %d\n", status); + return status; + } + + return 0; } |