lkml.org 
[lkml]   [2014]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation
From
Date
Hi,

On Sat, 2014-06-07 at 12:22 +0200, Rickard Strandqvist wrote:
> A check on a memory allocation is checked incorrectly.
>
> This was partly found using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> index d899d00..bb79928 100644
> --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
> @@ -1561,7 +1561,7 @@ static struct gelic_card *gelic_alloc_card_net(struct net_device **netdev)
> * alloc netdev
> */
> *netdev = alloc_etherdev(sizeof(struct gelic_port));
> - if (!netdev) {
> + if (!*netdev) {
> kfree(card->unalign);
> return NULL;
> }

Looks good, thanks for posting.

Dave, please queue for merge upstream.

Acked-by: Geoff Levand <geoff@infradead.org>



\
 
 \ /
  Last update: 2014-06-10 01:41    [W:0.049 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site