Skip to contentSkip to conversation

iscsi_ibft: Fix missing break in switch statement

PATCH In review Gustavo A. R. Silva 2 participants 3 messages Feb 11, 2019 – Feb 12, 2019 iSCSI boot firmware table (iBFT) driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iscsi_ibft: Fix missing break in switch statement

Add missing break statement in order to prevent the code from falling through to case ISCSI_BOOT_TGT_NAME, which is unnecessary.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes b33a84a38477 ("ibft: convert iscsi_ibft module to iscsi boot lib")
---
 drivers/firmware/iscsi_ibft.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/iscsi_ibft.c +1 -0
index 6bc8e6640d71..c51462f5aa1e 100644
@@ -542,6 +542,7 @@ static umode_t __init ibft_check_tgt_for(void *data, int type)
 	case ISCSI_BOOT_TGT_NIC_ASSOC:
 	case ISCSI_BOOT_TGT_CHAP_TYPE:
 		rc = S_IRUGO;
+		break;
 	case ISCSI_BOOT_TGT_NAME:
 		if (tgt->tgt_name_len)
 			rc = S_IRUGO;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 9 lines · Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling through to case ISCSI_BOOT_TGT_NAME, which is unnecessary.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Fixes b33a84a38477 ("ibft: convert iscsi_ibft module to iscsi boot lib")

Queued it up in https://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft.git

Quoted 19 lines
---
 drivers/firmware/iscsi_ibft.c | 1 +
 1 file changed, 1 insertion(+)
drivers/firmware/iscsi_ibft.c +1 -0
index 6bc8e6640d71..c51462f5aa1e 100644
@@ -542,6 +542,7 @@ static umode_t __init ibft_check_tgt_for(void *data, int type)
 	case ISCSI_BOOT_TGT_NIC_ASSOC:
 	case ISCSI_BOOT_TGT_CHAP_TYPE:
 		rc = S_IRUGO;
+		break;
 	case ISCSI_BOOT_TGT_NAME:
 		if (tgt->tgt_name_len)
 			rc = S_IRUGO;
Signature · 1 line
2.20.1
#2 lore raw
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 6 lines · Gustavo A. R. Silva

Add missing break statement in order to prevent the code from falling through to case ISCSI_BOOT_TGT_NAME, which is unnecessary.

This bug was found thanks to the ongoing efforts to enable -Wimplicit-fallthrough.

Quoted 6 lines
Quoted 3 lines
Fixes b33a84a38477 ("ibft: convert iscsi_ibft module to iscsi boot lib")

Queued it up in https://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft.git

Great.

Thanks, Konrad.
--
Gustavo