Commit a4898e78 authored by Nishka Dasgupta's avatar Nishka Dasgupta Committed by Greg Kroah-Hartman

staging: rtl8712: r8712_xmit_resource_alloc(): Change return values

Change call site of function r8712_xmit_resource_alloc to add a check
for its return value.
Change return values of r8712_xmit_resource_alloc from
_SUCCESS/_FAIL to 0/-ENOMEM.
Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e1b5fe74
...@@ -133,7 +133,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv, ...@@ -133,7 +133,8 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ - pxmitbuf->pbuf = pxmitbuf->pallocated_buf + XMITBUF_ALIGN_SZ -
((addr_t) (pxmitbuf->pallocated_buf) & ((addr_t) (pxmitbuf->pallocated_buf) &
(XMITBUF_ALIGN_SZ - 1)); (XMITBUF_ALIGN_SZ - 1));
r8712_xmit_resource_alloc(padapter, pxmitbuf); if (r8712_xmit_resource_alloc(padapter, pxmitbuf))
return _FAIL;
list_add_tail(&pxmitbuf->list, list_add_tail(&pxmitbuf->list,
&(pxmitpriv->free_xmitbuf_queue.queue)); &(pxmitpriv->free_xmitbuf_queue.queue));
pxmitbuf++; pxmitbuf++;
......
...@@ -120,11 +120,11 @@ int r8712_xmit_resource_alloc(struct _adapter *padapter, ...@@ -120,11 +120,11 @@ int r8712_xmit_resource_alloc(struct _adapter *padapter,
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL); pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!pxmitbuf->pxmit_urb[i]) { if (!pxmitbuf->pxmit_urb[i]) {
netdev_err(padapter->pnetdev, "pxmitbuf->pxmit_urb[i] == NULL\n"); netdev_err(padapter->pnetdev, "pxmitbuf->pxmit_urb[i] == NULL\n");
return _FAIL; return -ENOMEM;
} }
kmemleak_not_leak(pxmitbuf->pxmit_urb[i]); kmemleak_not_leak(pxmitbuf->pxmit_urb[i]);
} }
return _SUCCESS; return 0;
} }
void r8712_xmit_resource_free(struct _adapter *padapter, void r8712_xmit_resource_free(struct _adapter *padapter,
......
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