RE: next/master build: 198 builds: 1 failed, 197 passed, 1 error, 148 warnings (next-20180110)

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

 



	Calling kobject_put() after a failed kobject_init_and_add() seemed 
	wrong, and it also appears to be missing a kfree(), so I didn't want 
	to mess it up any further.

ttm_pool_kobj_release will do that, so no need kfree() here.
I will fix this warning today. Thanks.


Thanks
Roger(Hongbo.He)

-----Original Message-----
From: arndbergmann@xxxxxxxxx [mailto:arndbergmann@xxxxxxxxx] On Behalf Of Arnd Bergmann
Sent: Thursday, January 11, 2018 12:18 AM
To: Koenig, Christian <Christian.Koenig@xxxxxxx>
Cc: kernelci.org bot <bot@xxxxxxxxxxxx>; Kernel Build Reports Mailman List <kernel-build-reports@xxxxxxxxxxxxxxxx>; Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>; Thomas Hellstrom <thellstrom@xxxxxxxxxx>; Dave Airlie <airlied@xxxxxxxxxx>; He, Roger <Hongbo.He@xxxxxxx>; Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxx>; Francisco Jerez <currojerez@xxxxxxxxxx>; Viresh Kumar <vireshk@xxxxxxxxxx>; Shiraz Hashim <shiraz.linux.kernel@xxxxxxxxx>; Linus Walleij <linus.walleij@xxxxxxxxxx>; dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: next/master build: 198 builds: 1 failed, 197 passed, 1 error, 148 warnings (next-20180110)

On Wed, Jan 10, 2018 at 4:54 PM, Christian König <christian.koenig@xxxxxxx> wrote:
> Hi Arnd,
>
> Am 10.01.2018 um 16:45 schrieb Arnd Bergmann:
>>>
>>> 14 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c:1186:2: warning: 
>>> ignoring return value of 'register_shrinker', declared with 
>>> attribute warn_unused_result [-Wunused-result]
>>> 14 drivers/gpu/drm/ttm/ttm_page_alloc.c:485:2: warning: ignoring 
>>> return value of 'register_shrinker', declared with attribute 
>>> warn_unused_result [-Wunused-result]
>>
>> ttm and kvm are now the last user of register_shrinker that doesn't 
>> propagate the return code to its caller, all other callers got fixed 
>> in one way or another.
>>
>> I tried to fix this one too, but couldn't come up with a proper way 
>> of unwinding both
>> kobject_init_and_add() and ttm_pool_mm_shrink_init():
>>
>>          ret = kobject_init_and_add(&_manager->kobj, &ttm_pool_kobj_type,
>>                                     &glob->kobj, "pool");
>>          if (unlikely(ret != 0)) {
>>                  kobject_put(&_manager->kobj);
>>                  _manager = NULL;
>>                  return ret;
>>          }
>>
>>          ttm_pool_mm_shrink_init(_manager);
>>
>> Calling kobject_put() after a failed kobject_init_and_add() seemed 
>> wrong, and it also appears to be missing a kfree(), so I didn't want 
>> to mess it up any further. Added a few people to Cc that touched this 
>> file most, maybe one of them can have a look, or they already have a 
>> patch waiting to get merged.
>
>
> That isn't urgent, isn't it? So I would say I put it on my TODO list 
> and I'm going to take care of it no later than 4.17.
>
> Otherwise Roger or me could take a look tomorrow.

My understanding is that the warning will be in 4.16, so the fix should be as well, if only to get a clean build again. There were around a dozen such warnings when the warn_unused_result got added, but the others are all fixed in linux-next.

This is how the flag got added:

commit 64067c5cbfa24a2202b92e8fda7323610cad3043
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Fri Jan 5 13:25:45 2018 +1100

    mm,vmscan: mark register_shrinker() as __must_check

    There are users not checking for register_shrinker() failure.  Continuing
    with ignoring failure can lead to later oops at unregister_shrinker().

    Link: http://lkml.kernel.org/r/1511265757-15563-1-git-send-email-penguin-kernel@xxxxxxxxxxxxxxxxxxx
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>


        Arnd
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://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