Commit ec06d48f authored by Salah Triki's avatar Salah Triki Committed by Greg Kroah-Hartman

staging: rtl8192u: propagate errors in write_nic_dword

Propagate errors from kzalloc and usb_control_msg and change the
return type of write_nic_dword from void to int.
Signed-off-by: default avatarSalah Triki <salah.triki@acm.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28d653d7
...@@ -1132,7 +1132,7 @@ int read_nic_word(struct net_device *dev, int x, u16 *data); ...@@ -1132,7 +1132,7 @@ 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(struct net_device *dev, int x, u8 y);
int write_nic_byte_E(struct net_device *dev, int x, u8 y); int write_nic_byte_E(struct net_device *dev, int x, u8 y);
int 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); int write_nic_dword(struct net_device *dev, int x, u32 y);
void force_pci_posting(struct net_device *dev); void force_pci_posting(struct net_device *dev);
void rtl8192_rtx_disable(struct net_device *); void rtl8192_rtx_disable(struct net_device *);
......
...@@ -356,7 +356,7 @@ int write_nic_word(struct net_device *dev, int indx, u16 data) ...@@ -356,7 +356,7 @@ int write_nic_word(struct net_device *dev, int indx, u16 data)
} }
void write_nic_dword(struct net_device *dev, int indx, u32 data) int write_nic_dword(struct net_device *dev, int indx, u32 data)
{ {
int status; int status;
...@@ -365,7 +365,7 @@ void write_nic_dword(struct net_device *dev, int indx, u32 data) ...@@ -365,7 +365,7 @@ void write_nic_dword(struct net_device *dev, int indx, u32 data)
u32 *usbdata = kzalloc(sizeof(data), GFP_KERNEL); u32 *usbdata = kzalloc(sizeof(data), GFP_KERNEL);
if (!usbdata) if (!usbdata)
return; return -ENOMEM;
*usbdata = data; *usbdata = data;
status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), status = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
...@@ -375,9 +375,13 @@ void write_nic_dword(struct net_device *dev, int indx, u32 data) ...@@ -375,9 +375,13 @@ void write_nic_dword(struct net_device *dev, int indx, u32 data)
kfree(usbdata); kfree(usbdata);
if (status < 0) if (status < 0) {
netdev_err(dev, "write_nic_dword TimeOut! status: %d\n", netdev_err(dev, "write_nic_dword TimeOut! status: %d\n",
status); status);
return status;
}
return 0;
} }
......
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