[Bug,114711] ubsan: "shift exponent 32 is too large" in drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c:167:16
diff mbox

Message ID bug-114711-2300-wzuWVeR1Gg@https.bugzilla.kernel.org/
State New
Headers show

Commit Message

bugzilla-daemon@bugzilla.kernel.org June 2, 2016, 10:17 a.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=114711

Navin <navinp1912@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |navinp1912@gmail.com

--- Comment #1 from Navin <navinp1912@gmail.com> ---
Does this fix work for you ?

Patch
diff mbox

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
index 77c64972..0e40584 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/base.c
@@ -164,7 +164,7 @@  static int
 nvkm_gpio_fini(struct nvkm_subdev *subdev, bool suspend)
 {
        struct nvkm_gpio *gpio = nvkm_gpio(subdev);
-       u32 mask = (1 << gpio->func->lines) - 1;
+       u32 mask = (1LL << min(gpio->func->lines, 32)) - 1;

        gpio->func->intr_mask(gpio, NVKM_GPIO_TOGGLED, mask, 0);
        gpio->func->intr_stat(gpio, &mask, &mask);