drm/nouveau: fix missing break in switch statement
authorColin Ian King <colin.king@canonical.com>
Mon, 8 Oct 2018 20:47:36 +0000 (21:47 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 19 Feb 2019 22:59:58 +0000 (08:59 +1000)
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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_abi16.c

index b06cdac8f3a2bf0e0041a865cf3103379f1e11ce..a95ec3783f399e9a3ca3304881cdd08ae00a27bd 100644 (file)
@@ -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;