[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6FEE@saturn3.aculab.com>
Date: Thu, 13 Sep 2012 09:31:45 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Peter Senna Tschudin" <peter.senna@...il.com>,
"Hansjoerg Lipp" <hjlipp@....de>
Cc: <kernel-janitors@...r.kernel.org>,
"Tilman Schmidt" <tilman@...p.cc>,
"Karsten Keil" <isdn@...ux-pingi.de>,
<gigaset307x-common@...ts.sourceforge.net>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 9/9] drivers/isdn/gigaset/common.c: Remove useless kfree
> Remove useless kfree() and clean up code related to the removal.
...
> diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
> index aa41485..30a6b17 100644
> --- a/drivers/isdn/gigaset/common.c
> +++ b/drivers/isdn/gigaset/common.c
> @@ -1123,7 +1123,6 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
> return drv;
>
> error:
> - kfree(drv->cs);
> kfree(drv);
> return NULL;
> }
>
Seems to me that (assuming kfree(NULL) is ok) the kfree()
is best left in - just in case some other error path is
added after drv->cs is assigned.
Better safe than a memory leak.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists