linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/i915: fix possible memory leak in intel_hdcp_auth_downstream()
@ 2019-07-04 10:45 Wei Yongjun
  2019-08-01 10:18 ` Jani Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-07-04 10:45 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Sean Paul
  Cc: Wei Yongjun, intel-gfx, dri-devel, linux-kernel, kernel-janitors

'ksv_fifo' is malloced in intel_hdcp_auth_downstream() and should be
freed before leaving from the error handling cases, otherwise it will
cause memory leak.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index bc3a94d491c4..27bd7276a82d 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -536,7 +536,8 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector)
 
 	if (drm_hdcp_check_ksvs_revoked(dev, ksv_fifo, num_downstream)) {
 		DRM_ERROR("Revoked Ksv(s) in ksv_fifo\n");
-		return -EPERM;
+		ret = -EPERM;
+		goto err;
 	}
 
 	/*




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

* Re: [PATCH -next] drm/i915: fix possible memory leak in intel_hdcp_auth_downstream()
  2019-07-04 10:45 [PATCH -next] drm/i915: fix possible memory leak in intel_hdcp_auth_downstream() Wei Yongjun
@ 2019-08-01 10:18 ` Jani Nikula
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2019-08-01 10:18 UTC (permalink / raw)
  To: Wei Yongjun, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	Daniel Vetter, Sean Paul
  Cc: Wei Yongjun, intel-gfx, dri-devel, linux-kernel, kernel-janitors

On Thu, 04 Jul 2019, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> 'ksv_fifo' is malloced in intel_hdcp_auth_downstream() and should be
> freed before leaving from the error handling cases, otherwise it will
> cause memory leak.


Thanks for the patch, sorry for the delay, pushed to
drm-intel-next-queued.

BR,
Jani.

>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index bc3a94d491c4..27bd7276a82d 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -536,7 +536,8 @@ int intel_hdcp_auth_downstream(struct intel_connector *connector)
>  
>  	if (drm_hdcp_check_ksvs_revoked(dev, ksv_fifo, num_downstream)) {
>  		DRM_ERROR("Revoked Ksv(s) in ksv_fifo\n");
> -		return -EPERM;
> +		ret = -EPERM;
> +		goto err;
>  	}
>  
>  	/*
>
>
>

-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2019-08-01 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04 10:45 [PATCH -next] drm/i915: fix possible memory leak in intel_hdcp_auth_downstream() Wei Yongjun
2019-08-01 10:18 ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).