Skip to contentSkip to conversation

drm/nouveau: fix missing break in switch statement

PATCH In review Colin King 2 participants 3 messages Oct 8, 2018 – Jan 29, 2019

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/nouveau: fix missing break in switch statement

From: Colin Ian King <[email protected]>

The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up re-assigning the getparam->value to an undesired value. Fix this by adding in the missing break.

Detected by CoverityScan, CID#1460507 ("Missing break in switch")

Fixes 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")
---
 drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +1 -0
index e67a471331b5..6ec745873bc5 100644
@@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
 			WARN_ON(1);
 			break;
 		}
+		break;
 	case NOUVEAU_GETPARAM_FB_SIZE:
 		getparam->value = drm->gem.vram_available;
 		break;
Signature · 6 lines
2.17.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Colin King

From: Colin Ian King <[email protected]>

The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up re-assigning the getparam->value to an undesired value. Fix this by adding in the missing break.

Detected by CoverityScan, CID#1460507 ("Missing break in switch")

Fixes 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")

Friendly ping:

Who can take this?

Thanks
--
Gustavo

Quoted 17 lines
---
 drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +1 -0
index e67a471331b5..6ec745873bc5 100644
@@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
 			WARN_ON(1);
 			break;
 		}
+		break;
 	case NOUVEAU_GETPARAM_FB_SIZE:
 		getparam->value = drm->gem.vram_available;
 		break;
#2 lore raw
Quoted 12 lines · Gustavo A. R. Silva
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up re-assigning the getparam->value to an undesired value. Fix this by adding in the missing break.

Detected by CoverityScan, CID#1460507 ("Missing break in switch")

Quoted 9 lines
Quoted 2 lines
Fixes 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")

Friendly ping:

Who can take this?

BTW, this should be tagged for stable:

Thanks
--
Gustavo

Quoted 4 lines
Quoted 4 lines
---
 drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

drivers/gpu/drm/nouveau/nouveau_abi16.c nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) · line 220

Quoted 13 lines
drivers/gpu/drm/nouveau/nouveau_abi16.c +1 -0
index e67a471331b5..6ec745873bc5 100644
@@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
 			WARN_ON(1);
 			break;
 		}
+		break;
 	case NOUVEAU_GETPARAM_FB_SIZE:
 		getparam->value = drm->gem.vram_available;
 		break;

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau