* [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation
@ 2014-06-07 10:22 Rickard Strandqvist
2014-06-09 23:21 ` Geoff Levand
2014-06-11 7:15 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2014-06-07 10:22 UTC (permalink / raw)
To: Geoff Levand, netdev; +Cc: Rickard Strandqvist, cbe-oss-dev, linux-kernel
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;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation
2014-06-07 10:22 [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation Rickard Strandqvist
@ 2014-06-09 23:21 ` Geoff Levand
2014-06-11 7:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Geoff Levand @ 2014-06-09 23:21 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, cbe-oss-dev, linux-kernel, Rickard Strandqvist
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation
2014-06-07 10:22 [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation Rickard Strandqvist
2014-06-09 23:21 ` Geoff Levand
@ 2014-06-11 7:15 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-06-11 7:15 UTC (permalink / raw)
To: rickard_strandqvist; +Cc: geoff, netdev, cbe-oss-dev, linux-kernel
From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Date: Sat, 7 Jun 2014 12:22:08 +0200
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-11 7:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-07 10:22 [PATCH] net: ethernet: toshiba: ps3_gelic_net.c: Cleaning up a check on a memory allocation Rickard Strandqvist
2014-06-09 23:21 ` Geoff Levand
2014-06-11 7:15 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.