[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ziobk03e.fsf@miraculix.mork.no>
Date: Wed, 17 Aug 2016 15:15:49 +0200
From: Bjørn Mork <bjorn@...k.no>
To: Oliver Neukum <oneukum@...e.com>
Cc: linux-usb@...r.kernel.org, netdev@...r.kernel.org,
davem@...emloft.net, stern@...land.harvard.edu
Subject: Re: [PATCH 2/2] kaweth: fix oops upon failed memory allocation
Oliver Neukum <oneukum@...e.com> writes:
> Just return an error upon failure.
>
> Signed-off-by: Oliver Neukum <oneukum@...e.com>
> ---
> drivers/net/usb/kaweth.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
> index 37bf715..3cd6906 100644
> --- a/drivers/net/usb/kaweth.c
> +++ b/drivers/net/usb/kaweth.c
> @@ -1049,6 +1049,8 @@ static int kaweth_probe(
> /* Download the firmware */
> dev_info(dev, "Downloading firmware...\n");
> kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
> + if (!kaweth->firmware_buf)
> + return -ENOMEM;
Eh, that should be "goto err_free_netdev;", shouldn't it?
Bjørn
Powered by blists - more mailing lists