lkml.org 
[lkml]   [2023]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/4] platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
On Mon, Nov 13, 2023 at 04:15:50PM +0200, Ilpo Järvinen wrote:
> This relates to the 2nd problem (missing kobject_put()) and will be
> covered by the other patch. Don't try to solve this in the first patch
> at all!
>
> There are two indepedent problems:
> - Before kobject_init_and_add(), kfree() is missing
> - After kobject_init_and_add(), kobject_put() is missing

It's the same problem, though. The attr_name_kobj is leaked on all the
error paths. It's just that it needs to be freed different ways
depending on where you are. To me splitting it up makes it harder to
review and I would not allow it in Staging. You can't fix half the
problem.

regards,
dan carpenter

\
 
 \ /
  Last update: 2023-11-20 13:58    [W:0.051 / U:1.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site