[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c5b64dc.db888.1726a03b710.Coremail.dinghao.liu@zju.edu.cn>
Date: Sun, 31 May 2020 17:15:27 +0800 (GMT+08:00)
From: dinghao.liu@....edu.cn
To: "Markus Elfring" <Markus.Elfring@....de>
Cc: dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
"Ben Skeggs" <bskeggs@...hat.com>,
"David Airlie" <airlied@...ux.ie>, "Kangjie Lu" <kjlu@....edu>
Subject: Re: Re: drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
> > I just found that clk is referenced by pclk in this function. When clk is freed,
> > pclk will be allocated in gm20b_clk_new_speedo0(). Thus we should not release clk
> > in this function and there is no bug here.
>
> Can there be a need to release a clock object after a failed gk20a_clk_ctor() call?
>
I think this mainly depends on pclk pointer. It seems that the caller of
gm20b_clk_new() always expects pclk to be allocated unless it returns -ENOMEM,
which means kzalloc() failed. If gk20a_clk_ctor() never returns such an error
code, we may need not to release this clock object.
Regards,
Dinghao
Powered by blists - more mailing lists