All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init()
@ 2016-06-29 21:52 Alexey Khoroshilov
  2016-07-12 12:11   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Khoroshilov @ 2016-06-29 21:52 UTC (permalink / raw)
  To: David Airlie; +Cc: Alexey Khoroshilov, dri-devel, linux-kernel, ldv-project

If class_create() fails, there is no need for class_destroy().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
 drivers/gpu/drm/drm_dp_aux_dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c
index 3334baacf43d..734f86a345f6 100644
--- a/drivers/gpu/drm/drm_dp_aux_dev.c
+++ b/drivers/gpu/drm/drm_dp_aux_dev.c
@@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void)
 
 	drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev");
 	if (IS_ERR(drm_dp_aux_dev_class)) {
-		res = PTR_ERR(drm_dp_aux_dev_class);
-		goto out;
+		return PTR_ERR(drm_dp_aux_dev_class);
 	}
 	drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;
 
-- 
1.9.1

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

* Re: [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init()
  2016-06-29 21:52 [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init() Alexey Khoroshilov
@ 2016-07-12 12:11   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-07-12 12:11 UTC (permalink / raw)
  To: Alexey Khoroshilov; +Cc: David Airlie, ldv-project, dri-devel, linux-kernel

On Thu, Jun 30, 2016 at 12:52:15AM +0300, Alexey Khoroshilov wrote:
> If class_create() fails, there is no need for class_destroy().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Applied to drm-misc, thanks for the patch. Out of curiosity, how exactly
did you spot this bug?
-Daniel

> ---
>  drivers/gpu/drm/drm_dp_aux_dev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c
> index 3334baacf43d..734f86a345f6 100644
> --- a/drivers/gpu/drm/drm_dp_aux_dev.c
> +++ b/drivers/gpu/drm/drm_dp_aux_dev.c
> @@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void)
>  
>  	drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev");
>  	if (IS_ERR(drm_dp_aux_dev_class)) {
> -		res = PTR_ERR(drm_dp_aux_dev_class);
> -		goto out;
> +		return PTR_ERR(drm_dp_aux_dev_class);
>  	}
>  	drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init()
@ 2016-07-12 12:11   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2016-07-12 12:11 UTC (permalink / raw)
  To: Alexey Khoroshilov; +Cc: ldv-project, linux-kernel, dri-devel

On Thu, Jun 30, 2016 at 12:52:15AM +0300, Alexey Khoroshilov wrote:
> If class_create() fails, there is no need for class_destroy().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>

Applied to drm-misc, thanks for the patch. Out of curiosity, how exactly
did you spot this bug?
-Daniel

> ---
>  drivers/gpu/drm/drm_dp_aux_dev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c
> index 3334baacf43d..734f86a345f6 100644
> --- a/drivers/gpu/drm/drm_dp_aux_dev.c
> +++ b/drivers/gpu/drm/drm_dp_aux_dev.c
> @@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void)
>  
>  	drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev");
>  	if (IS_ERR(drm_dp_aux_dev_class)) {
> -		res = PTR_ERR(drm_dp_aux_dev_class);
> -		goto out;
> +		return PTR_ERR(drm_dp_aux_dev_class);
>  	}
>  	drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init()
  2016-07-12 12:11   ` Daniel Vetter
  (?)
@ 2016-09-23 10:26   ` Alexey Khoroshilov
  -1 siblings, 0 replies; 4+ messages in thread
From: Alexey Khoroshilov @ 2016-09-23 10:26 UTC (permalink / raw)
  To: David Airlie, ldv-project, dri-devel, linux-kernel

Dear Daniel,

Sorry for long response.

> Applied to drm-misc, thanks for the patch. Out of curiosity, how
> exactly did you spot this bug?

We use static analysis tools that check various rules on correct usage
of kernel core API. An example of error trace for the rm_dp_aux_dev case
you can see here [1].

Some addition details are described in a paper [2].

[1]
http://linuxtesting.org/results/impl_reports_admin?action=preview&num=137
[2]
http://www.ispras.ru/en/publications/configurable_toolset_for_static_verification_of_operating_systems_kernel_modules.pdf


Best regards,
Alexey


On 12.07.2016 14:11, Daniel Vetter wrote:
> On Thu, Jun 30, 2016 at 12:52:15AM +0300, Alexey Khoroshilov wrote:
>> If class_create() fails, there is no need for class_destroy().
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
> 
> Applied to drm-misc, thanks for the patch. Out of curiosity, how exactly
> did you spot this bug?
> -Daniel
> 
>> ---
>>  drivers/gpu/drm/drm_dp_aux_dev.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c
>> index 3334baacf43d..734f86a345f6 100644
>> --- a/drivers/gpu/drm/drm_dp_aux_dev.c
>> +++ b/drivers/gpu/drm/drm_dp_aux_dev.c
>> @@ -355,8 +355,7 @@ int drm_dp_aux_dev_init(void)
>>  
>>  	drm_dp_aux_dev_class = class_create(THIS_MODULE, "drm_dp_aux_dev");
>>  	if (IS_ERR(drm_dp_aux_dev_class)) {
>> -		res = PTR_ERR(drm_dp_aux_dev_class);
>> -		goto out;
>> +		return PTR_ERR(drm_dp_aux_dev_class);
>>  	}
>>  	drm_dp_aux_dev_class->dev_groups = drm_dp_aux_groups;
>>  
>> -- 
>> 1.9.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

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

end of thread, other threads:[~2016-09-23 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 21:52 [PATCH] drm_aux-dev: fix error handling in drm_dp_aux_dev_init() Alexey Khoroshilov
2016-07-12 12:11 ` Daniel Vetter
2016-07-12 12:11   ` Daniel Vetter
2016-09-23 10:26   ` Alexey Khoroshilov

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.