All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: Remove unnecessary NULL test before kfree in 'radeon_connector_free_edid'
@ 2023-07-26 16:23 Srinivasan Shanmugam
  2023-07-26 18:29 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivasan Shanmugam @ 2023-07-26 16:23 UTC (permalink / raw)
  To: Christian König, Alex Deucher, Guchun Chen
  Cc: Srinivasan Shanmugam, amd-gfx

Fixes the below:

WARNING: kfree(NULL) is safe and this check is probably not required.

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
---
 drivers/gpu/drm/radeon/radeon_connectors.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 4ceceb972e8d..d2f02c3dfce2 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -333,10 +333,8 @@ static void radeon_connector_free_edid(struct drm_connector *connector)
 {
 	struct radeon_connector *radeon_connector = to_radeon_connector(connector);
 
-	if (radeon_connector->edid) {
-		kfree(radeon_connector->edid);
-		radeon_connector->edid = NULL;
-	}
+	kfree(radeon_connector->edid);
+	radeon_connector->edid = NULL;
 }
 
 static int radeon_ddc_get_modes(struct drm_connector *connector)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/radeon: Remove unnecessary NULL test before kfree in 'radeon_connector_free_edid'
  2023-07-26 16:23 [PATCH] drm/radeon: Remove unnecessary NULL test before kfree in 'radeon_connector_free_edid' Srinivasan Shanmugam
@ 2023-07-26 18:29 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-07-26 18:29 UTC (permalink / raw)
  To: Srinivasan Shanmugam
  Cc: Alex Deucher, amd-gfx, Christian König, Guchun Chen

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

On Wed, Jul 26, 2023 at 12:24 PM Srinivasan Shanmugam
<srinivasan.shanmugam@amd.com> wrote:
>
> Fixes the below:
>
> WARNING: kfree(NULL) is safe and this check is probably not required.
>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
> ---
>  drivers/gpu/drm/radeon/radeon_connectors.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 4ceceb972e8d..d2f02c3dfce2 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -333,10 +333,8 @@ static void radeon_connector_free_edid(struct drm_connector *connector)
>  {
>         struct radeon_connector *radeon_connector = to_radeon_connector(connector);
>
> -       if (radeon_connector->edid) {
> -               kfree(radeon_connector->edid);
> -               radeon_connector->edid = NULL;
> -       }
> +       kfree(radeon_connector->edid);
> +       radeon_connector->edid = NULL;
>  }
>
>  static int radeon_ddc_get_modes(struct drm_connector *connector)
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-26 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 16:23 [PATCH] drm/radeon: Remove unnecessary NULL test before kfree in 'radeon_connector_free_edid' Srinivasan Shanmugam
2023-07-26 18:29 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.