drm/nouveau: fix missing break in switch statement
Subsystems (4)
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")
--- drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nouveau_abi16.c +1 -0
@@ -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
Quoted 11 lines · Colin King
From: Colin Ian King <[email protected]>
The
NOUVEAU_GETPARAM_PCI_DEVICEcase is missing a break statement and falls through to the followingNOUVEAU_GETPARAM_BUS_TYPEcase and may end up re-assigning thegetparam->valueto 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")Signed-off-by Colin Ian King <[email protected]>
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@@ -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 ;
Quoted 12 lines · Gustavo A. R. Silva
Quoted 9 lines · Colin King
From: Colin Ian King <[email protected]>
The
NOUVEAU_GETPARAM_PCI_DEVICEcase is missing a break statement and falls through to the followingNOUVEAU_GETPARAM_BUS_TYPEcase and may end up re-assigning thegetparam->valueto 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")Signed-off-by Colin Ian King <[email protected]>Reviewed-by Gustavo A. R. Silva <[email protected]>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@@ -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