Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234826 > unrolled thread

Re: [PATCH] [net] orinoco_usb:Fix error handling in ezusb_probe()

Started byKalle Valo <kvalo@codeaurora.org>
First post2015-09-29 10:40 +0200
Last post2015-09-29 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] [net] orinoco_usb:Fix error handling in ezusb_probe() Kalle Valo <kvalo@codeaurora.org> - 2015-09-29 10:40 +0200

#1234826 — Re: [PATCH] [net] orinoco_usb:Fix error handling in ezusb_probe()

FromKalle Valo <kvalo@codeaurora.org>
Date2015-09-29 10:40 +0200
SubjectRe: [PATCH] [net] orinoco_usb:Fix error handling in ezusb_probe()
Message-ID<qdYC6-1c8-19@gated-at.bofh.it>
RUC_Soft_Sec <zy900702@163.com> writes:

> Current code assigns 0 to variable 'retval', which makes ezusb_probe() to
> return success even if alloc_orinocodev() fails.
>
> The related code snippets in mantis_dma_init() is as following.
>
> 1573 static int ezusb_probe(struct usb_interface *interface,
> 1574                        const struct usb_device_id *id)
> 1575 {
>
>                  ....
>
> 1583         int retval = 0;
> 1584         int i;
> 1585
> 1586         priv = alloc_orinocodev(sizeof(*upriv), &udev->dev,
> 1587                                 ezusb_hard_reset, NULL);
> 1588         if (!priv) {
> 1589                 err("Couldn't allocate orinocodev");
> 1590                 goto exit;
> 1591         }
>                  ...
>
> 1729  exit:
> 1730         if (fw_entry) {
> 1731                 firmware.code = NULL;
> 1732                 firmware.size = 0;
> 1733                 release_firmware(fw_entry);
> 1734         }
> 1735         usb_set_intfdata(interface, upriv);
> 1736         return retval;
> 1737 }
>
>  Fix it by checking the return value from alloc_orinocodev() and assigns
> '-ENOMEM' to variable 'retval' in the case of error.
>
> Signed-off-by: Zhang Yan <zy900702@163.com>---
>  orinoco_usb.c |    1 +
>  1 file changed, 1 insertion(+)
> diff --git a/orinoco_usb.c b/orinoco_usb.c

The patch looks corrupted. And the from header doesn't contain a proper
name.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web