* [PATCH][net-next] cxgb4: fix missing break in switch and indent return statements
@ 2017-10-13 16:29 Colin King
2017-10-15 1:38 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-10-13 16:29 UTC (permalink / raw)
To: Ganesh Goudar, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The break statement for the Macronix case is missing and will
fall through to the Winbond case and re-assign the size setting.
Fix this by adding the missing break statement. Also correctly
indent the return statements.
Detected by CoverityScan, CID#1458020 ("Missing break in switch")
Fixes: 96ac18f14a5a ("cxgb4: Add support for new flash parts")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index b3fd1f457639..fe7db70a9fa6 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -8289,7 +8289,7 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Micron Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
break;
}
@@ -8308,8 +8308,9 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Macronix Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
+ break;
}
case 0xef: { /* Winbond */
/* This Density -> Size decoding table is taken from Winbond
@@ -8326,7 +8327,7 @@ static int t4_get_flash_params(struct adapter *adap)
default:
dev_err(adap->pdev_dev, "Winbond Flash Part has bad size, ID = %#x, Density code = %#x\n",
flashid, density);
- return -EINVAL;
+ return -EINVAL;
}
break;
}
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][net-next] cxgb4: fix missing break in switch and indent return statements
2017-10-13 16:29 [PATCH][net-next] cxgb4: fix missing break in switch and indent return statements Colin King
@ 2017-10-15 1:38 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-10-15 1:38 UTC (permalink / raw)
To: colin.king; +Cc: ganeshgr, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Fri, 13 Oct 2017 17:29:00 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> The break statement for the Macronix case is missing and will
> fall through to the Winbond case and re-assign the size setting.
> Fix this by adding the missing break statement. Also correctly
> indent the return statements.
>
> Detected by CoverityScan, CID#1458020 ("Missing break in switch")
>
> Fixes: 96ac18f14a5a ("cxgb4: Add support for new flash parts")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-15 1:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13 16:29 [PATCH][net-next] cxgb4: fix missing break in switch and indent return statements Colin King
2017-10-15 1:38 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).