diff mbox series

[1/3] drm/tests: Fix kunit_release_action ctx argument

Message ID 20230920-kunit-kasan-fixes-v1-1-1a0fc261832d@riseup.net (mailing list archive)
State New, archived
Headers show
Series Fix a couble of bugs in drm_kunit_helpers.c | expand

Commit Message

Arthur Grillo Sept. 20, 2023, 6:11 a.m. UTC
The kunit_action_platform_driver_unregister is added with
&fake_platform_driver as ctx, but the kunit_release_action is called
pdev as ctx. Fix that by replacing it with &fake_platform_driver.

Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions")
Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/tests/drm_kunit_helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Ripard Sept. 20, 2023, 6:29 a.m. UTC | #1
On Wed, 20 Sep 2023 03:11:36 -0300, Arthur Grillo wrote:
> The kunit_action_platform_driver_unregister is added with
> &fake_platform_driver as ctx, but the kunit_release_action is called
> pdev as ctx. Fix that by replacing it with &fake_platform_driver.
> 
> Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions")
> 
> [ ... ]

Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime
Maíra Canal Sept. 27, 2023, 10:47 p.m. UTC | #2
Hi Arthur,

On 9/20/23 03:11, Arthur Grillo wrote:
> The kunit_action_platform_driver_unregister is added with
> &fake_platform_driver as ctx, but the kunit_release_action is called
> pdev as ctx. Fix that by replacing it with &fake_platform_driver.
> 
> Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions")
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>

Reviewed-by: Maíra Canal <mairacanal@riseup.net>

Do you need me to apply this patch to drm-misc-fixes?

Best Regards,
- Maíra

> ---
>   drivers/gpu/drm/tests/drm_kunit_helpers.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> index 3d624ff2f651..3150dbc647ee 100644
> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
> @@ -118,7 +118,7 @@ void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
>   
>   	kunit_release_action(test,
>   			     kunit_action_platform_driver_unregister,
> -			     pdev);
> +			     &fake_platform_driver);
>   }
>   EXPORT_SYMBOL_GPL(drm_kunit_helper_free_device);
>   
>
Arthur Grillo Sept. 27, 2023, 10:52 p.m. UTC | #3
On 27/09/23 19:47, Maira Canal wrote:
> Hi Arthur,
> 
> On 9/20/23 03:11, Arthur Grillo wrote:
>> The kunit_action_platform_driver_unregister is added with
>> &fake_platform_driver as ctx, but the kunit_release_action is called
>> pdev as ctx. Fix that by replacing it with &fake_platform_driver.
>>
>> Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions")
>> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> 
> Reviewed-by: Maíra Canal <mairacanal@riseup.net>
> 
> Do you need me to apply this patch to drm-misc-fixes?

Yes, please do, if possible.

Thanks,
~Arthur Grillo

> 
> Best Regards,
> - Maíra
> 
>> ---
>>   drivers/gpu/drm/tests/drm_kunit_helpers.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
>> index 3d624ff2f651..3150dbc647ee 100644
>> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
>> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
>> @@ -118,7 +118,7 @@ void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
>>         kunit_release_action(test,
>>                    kunit_action_platform_driver_unregister,
>> -                 pdev);
>> +                 &fake_platform_driver);
>>   }
>>   EXPORT_SYMBOL_GPL(drm_kunit_helper_free_device);
>>
Maíra Canal Sept. 30, 2023, 3:17 p.m. UTC | #4
Hi Arthur,

On 9/27/23 19:52, Arthur Grillo wrote:
> 
> 
> On 27/09/23 19:47, Maira Canal wrote:
>> Hi Arthur,
>>
>> On 9/20/23 03:11, Arthur Grillo wrote:
>>> The kunit_action_platform_driver_unregister is added with
>>> &fake_platform_driver as ctx, but the kunit_release_action is called
>>> pdev as ctx. Fix that by replacing it with &fake_platform_driver.
>>>
>>> Fixes: 4f2b0b583baa ("drm/tests: helpers: Switch to kunit actions")
>>> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
>>
>> Reviewed-by: Maíra Canal <mairacanal@riseup.net>
>>
>> Do you need me to apply this patch to drm-misc-fixes?
> 
> Yes, please do, if possible.

Applied to drm-misc/drm-misc-fixes!

Thanks,
- Maíra

> 
> Thanks,
> ~Arthur Grillo
> 
>>
>> Best Regards,
>> - Maíra
>>
>>> ---
>>>    drivers/gpu/drm/tests/drm_kunit_helpers.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
>>> index 3d624ff2f651..3150dbc647ee 100644
>>> --- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
>>> +++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
>>> @@ -118,7 +118,7 @@ void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
>>>          kunit_release_action(test,
>>>                     kunit_action_platform_driver_unregister,
>>> -                 pdev);
>>> +                 &fake_platform_driver);
>>>    }
>>>    EXPORT_SYMBOL_GPL(drm_kunit_helper_free_device);
>>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tests/drm_kunit_helpers.c b/drivers/gpu/drm/tests/drm_kunit_helpers.c
index 3d624ff2f651..3150dbc647ee 100644
--- a/drivers/gpu/drm/tests/drm_kunit_helpers.c
+++ b/drivers/gpu/drm/tests/drm_kunit_helpers.c
@@ -118,7 +118,7 @@  void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
 
 	kunit_release_action(test,
 			     kunit_action_platform_driver_unregister,
-			     pdev);
+			     &fake_platform_driver);
 }
 EXPORT_SYMBOL_GPL(drm_kunit_helper_free_device);