cdc_ncm: return -ENOMEM if kzalloc fails
return -ENOMEM instead if kzalloc of cdc_ncm_ctx structure is failed. and also remove the comparision of ctx structure with NULL and make it as !ctx. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
537aadc3a4
commit
8f0923c17d
1 changed files with 2 additions and 2 deletions
|
@ -362,8 +362,8 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
|
||||||
u8 iface_no;
|
u8 iface_no;
|
||||||
|
|
||||||
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
|
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
|
||||||
if (ctx == NULL)
|
if (!ctx)
|
||||||
return -ENODEV;
|
return -ENOMEM;
|
||||||
|
|
||||||
hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
|
||||||
ctx->tx_timer.function = &cdc_ncm_tx_timer_cb;
|
ctx->tx_timer.function = &cdc_ncm_tx_timer_cb;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue