]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drm: NULL pointer dereference [null-pointer-deref] (CWE 476) problem
authorJoe Moriarty <joe.moriarty@oracle.com>
Tue, 20 Feb 2018 19:11:57 +0000 (14:11 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 6 Mar 2018 07:14:16 +0000 (08:14 +0100)
The Parfait (version 2.1.0) static code analysis tool found the
following NULL pointer dereference problem.

- drivers/gpu/drm/drm_drv.c
Any calls to drm_minor_get_slot() could result in the return of a NULL
pointer when an invalid DRM device type is encountered.  The
return of NULL was removed with BUG() from drm_minor_get_slot().

Signed-off-by: Joe Moriarty <joe.moriarty@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180220191157.100960-3-joe.moriarty@oracle.com
drivers/gpu/drm/drm_drv.c

index 9acc1e15781381ad5979dd1efa57cdd764822a78..a1b9338736e3be4aafc5522c217f75ce3dcea832 100644 (file)
@@ -99,7 +99,7 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev,
        case DRM_MINOR_CONTROL:
                return &dev->control;
        default:
-               return NULL;
+               BUG();
        }
 }