Re: [PATCH] drm/radeon: Remove redundant NULL check before kfree

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

 



On Sun, Feb 24, 2013 at 6:18 PM, Syam Sidhardhan <syamsidhardh@xxxxxxxxx> wrote:
> kfree on NULL pointer is a no-op.
>
> Signed-off-by: Syam Sidhardhan <s.syam@xxxxxxxxxxx>
Reviewed-by: Jerome Glisse <jglisse@xxxxxxxxxx>

> ---
>  drivers/gpu/drm/radeon/radeon_connectors.c |    6 ++----
>  drivers/gpu/drm/radeon/radeon_pm.c         |    3 +--
>  2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 2399f25..57828e6 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -643,8 +643,7 @@ static void radeon_connector_destroy(struct drm_connector *connector)
>  {
>         struct radeon_connector *radeon_connector = to_radeon_connector(connector);
>
> -       if (radeon_connector->edid)
> -               kfree(radeon_connector->edid);
> +       kfree(radeon_connector->edid);
>         kfree(radeon_connector->con_priv);
>         drm_sysfs_connector_remove(connector);
>         drm_connector_cleanup(connector);
> @@ -1209,8 +1208,7 @@ static void radeon_dp_connector_destroy(struct drm_connector *connector)
>         struct radeon_connector *radeon_connector = to_radeon_connector(connector);
>         struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv;
>
> -       if (radeon_connector->edid)
> -               kfree(radeon_connector->edid);
> +       kfree(radeon_connector->edid);
>         if (radeon_dig_connector->dp_i2c_bus)
>                 radeon_i2c_destroy(radeon_dig_connector->dp_i2c_bus);
>         kfree(radeon_connector->con_priv);
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index 338fd6a..2a51611 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -662,8 +662,7 @@ void radeon_pm_fini(struct radeon_device *rdev)
>                 device_remove_file(rdev->dev, &dev_attr_power_method);
>         }
>
> -       if (rdev->pm.power_state)
> -               kfree(rdev->pm.power_state);
> +       kfree(rdev->pm.power_state);
>
>         radeon_hwmon_fini(rdev);
>  }
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux