Re: [PATCH] gianfar: reduce stack usage in gianfar_ethtool.c

From: Wang Shaoyan
Date: Tue Aug 09 2011 - 12:37:58 EST


I thought kfree should not call, when kmalloc is failed. Now I think
is fine, thanks, it is much clearer

> Perhaps it'd be clearer to use:
>
>        local_rqfpr = kmalloc(...)
>        local_rqfcr = kmalloc(...)
>        if (!local_rqfpr || !local_rqfcr) {
>                pr_err(...)
>                ret = -ENOMEM;
>                goto err;
>        }
>
> [...]
>
> err:
>        kfree(local_rqfpr);
>        kfree(local_rqfcr);
>        return ret;
>
> Is the "local_" prefix useful?
> It seems like visual noise to me.

They are some temporary variable, we better to left them

>
>



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