diff options
author | Devendra Naga <devendra.aaru@gmail.com> | 2013-03-29 23:03:22 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-30 17:31:24 -0400 |
commit | 8f0923c17d34ac838b7f57709f87fe33f76ee219 (patch) | |
tree | bda5f77fefd354d5942e4f8be54778521e246e8b /drivers/net/usb | |
parent | 537aadc3a4a0336e432c789c577b7efa0adf4af0 (diff) | |
download | linux-8f0923c17d34ac838b7f57709f87fe33f76ee219.tar.bz2 |
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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 4709fa3497cf..44a989cd9fb2 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -362,8 +362,8 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ u8 iface_no; ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); - if (ctx == NULL) - return -ENODEV; + if (!ctx) + return -ENOMEM; hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); ctx->tx_timer.function = &cdc_ncm_tx_timer_cb; |