Re: [RFC PATCH 05/13] driver core: firmware loader: introducefirmware_buf

From: Borislav Petkov
Date: Thu Jul 26 2012 - 06:08:09 EST


On Thu, Jul 26, 2012 at 10:51:55AM +0800, Ming Lei wrote:
> On Wed, Jul 25, 2012 at 9:59 PM, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> > This is subtle: the caller of fw_free_buf might forget to assign NULL to
> > the buf ptr.
>
> Who is the caller? Since it is always called inside firmware loader, we should
> make sure that.
>
> > Why not pass struct firmware_priv *fw_priv to the function instead and ...
>
> No, it shouldn't. The lifetime of fw_priv is just same with request_firmware or
> its work_func pair, but firmware_buf may live much longer than fw_priv. You
> will see that fw_free_buf is the release function of kref in firmware_buf.

Actually, this is all moot since you're changing all this in later
patches. I'm staring at the code after patch 10/13 and the check is
gone.

So nevermind.

[ â ]

> Suppose you are right, it shouldn't be done in this patch since this
> patch just converts to firmware_buf.

Wherever you find its suitable.

Thanks.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/