Re: [PATCH 11/13] drm/edid: make drm_edid_duplicate() safe to call with NULL parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



LGTM.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@xxxxxxxxx>

On 4/21/2023 5:17 PM, Jani Nikula wrote:
It's a bit tedious to check for NULL before calling
drm_edid_duplicate(). Make it handle NULL parameter graciously.

Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
  drivers/gpu/drm/drm_edid.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 941f3d53a701..e0dbd9140726 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -2881,6 +2881,9 @@ EXPORT_SYMBOL(drm_edid_read_switcheroo);
   */
  struct edid *drm_edid_duplicate(const struct edid *edid)
  {
+	if (!edid)
+		return NULL;
+
  	return kmemdup(edid, edid_size(edid), GFP_KERNEL);
  }
  EXPORT_SYMBOL(drm_edid_duplicate);



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux