[PATCH] drm/amd/display: Add null check before access structs

Markus Elfring Markus.Elfring at web.de
Wed Jun 26 16:25:53 UTC 2024


> In enable_phantom_plane, we should better check null pointer before
> accessing various structs.

1. Can a wording approach (like the following) be a better change description?
   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10-rc5#n45

   A null pointer is stored in the local variable “phantom_plane” after a call
   of the function “create_phantom_plane” (as a data structure menber) failed.
   This pointer was used in subsequent statements where an undesirable
   dereference will be performed then.
   Thus add a corresponding return value check.


2. How do you think about to use a summary phrase like
   “Prevent null pointer dereference in enable_phantom_plane()”?

Regards,
Markus


More information about the amd-gfx mailing list