lkml.org 
[lkml]   [2014]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] firewire: fix NULL derefencing in fwnet_probe()
On Apr 29 Daeseok Youn wrote:
> "dev" and "net" are NULL when alloc_netdev() is failed.
> So just unlock and return an error.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>

Pushed to linux1394.git. Thank you.

> ---
> drivers/firewire/net.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
> index 4af0a7b..c398645 100644
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *unit,
>
> net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev);
> if (net == NULL) {
> - ret = -ENOMEM;
> - goto out;
> + mutex_unlock(&fwnet_device_mutex);
> + return -ENOMEM;
> }
>
> allocated_netdev = true;

--
Stefan Richter
-=====-====- -=-= -==--
http://arcgraph.de/sr/


\
 
 \ /
  Last update: 2014-05-12 14:41    [W:0.034 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site