diff mbox series

drm/selftests: missing error code in igt_buddy_alloc_smoke()

Message ID 20220307125458.GA16710@kili (mailing list archive)
State New, archived
Headers show
Series drm/selftests: missing error code in igt_buddy_alloc_smoke() | expand

Commit Message

Dan Carpenter March 7, 2022, 12:54 p.m. UTC
Set the error code to -ENOMEM if drm_random_order() fails.

Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/selftests/test-drm_buddy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Paneer Selvam, Arunpravin March 7, 2022, 2:54 p.m. UTC | #1
Reviewed-by:Arunpravin <Arunpravin.PaneerSelvam@amd.com>

On 07/03/22 6:24 pm, Dan Carpenter wrote:
> Set the error code to -ENOMEM if drm_random_order() fails.
> 
> Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/gpu/drm/selftests/test-drm_buddy.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
> index fa997f89522b..6eba590afa9b 100644
> --- a/drivers/gpu/drm/selftests/test-drm_buddy.c
> +++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
> @@ -488,8 +488,10 @@ static int igt_buddy_alloc_smoke(void *arg)
>  	}
>  
>  	order = drm_random_order(mm.max_order + 1, &prng);
> -	if (!order)
> +	if (!order) {
> +		err = -ENOMEM;
>  		goto out_fini;
> +	}
>  
>  	for (i = 0; i <= mm.max_order; ++i) {
>  		struct drm_buddy_block *block;
>
Christian König March 7, 2022, 4:14 p.m. UTC | #2
Pushed to drm-misc-next. Just one nit below.

Am 07.03.22 um 15:54 schrieb Arunpravin:
> Reviewed-by:Arunpravin <Arunpravin.PaneerSelvam@amd.com>

Some people are picky about using the full name here.

And you I think we should volunteer you for maintaining that stuff :)

So you might want to get commit rights for drm-misc-next as well.

Christian.

>
> On 07/03/22 6:24 pm, Dan Carpenter wrote:
>> Set the error code to -ENOMEM if drm_random_order() fails.
>>
>> Fixes: e6ff5ef81170 ("drm/selftests: add drm buddy smoke testcase")
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> ---
>>   drivers/gpu/drm/selftests/test-drm_buddy.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> index fa997f89522b..6eba590afa9b 100644
>> --- a/drivers/gpu/drm/selftests/test-drm_buddy.c
>> +++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
>> @@ -488,8 +488,10 @@ static int igt_buddy_alloc_smoke(void *arg)
>>   	}
>>   
>>   	order = drm_random_order(mm.max_order + 1, &prng);
>> -	if (!order)
>> +	if (!order) {
>> +		err = -ENOMEM;
>>   		goto out_fini;
>> +	}
>>   
>>   	for (i = 0; i <= mm.max_order; ++i) {
>>   		struct drm_buddy_block *block;
>>
Dan Carpenter March 7, 2022, 4:44 p.m. UTC | #3
On Mon, Mar 07, 2022 at 05:14:59PM +0100, Christian König wrote:
> Pushed to drm-misc-next. Just one nit below.
> 
> Am 07.03.22 um 15:54 schrieb Arunpravin:
> > Reviewed-by:Arunpravin <Arunpravin.PaneerSelvam@amd.com>
> 
> Some people are picky about using the full name here.
> 

Signed-off-by is like signing a legal document to say that you have not
stolen anyone else's copyrighted works (SCO lawsuit).  So it should be
whatever name you use to sign legal documents.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/gpu/drm/selftests/test-drm_buddy.c b/drivers/gpu/drm/selftests/test-drm_buddy.c
index fa997f89522b..6eba590afa9b 100644
--- a/drivers/gpu/drm/selftests/test-drm_buddy.c
+++ b/drivers/gpu/drm/selftests/test-drm_buddy.c
@@ -488,8 +488,10 @@  static int igt_buddy_alloc_smoke(void *arg)
 	}
 
 	order = drm_random_order(mm.max_order + 1, &prng);
-	if (!order)
+	if (!order) {
+		err = -ENOMEM;
 		goto out_fini;
+	}
 
 	for (i = 0; i <= mm.max_order; ++i) {
 		struct drm_buddy_block *block;