Re: [PATCH] interconnect: qcom: rpm: allocate enough data in probe()

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

 



On Tue, May 23, 2023 at 10:31:27AM +0200, Konrad Dybcio wrote:
> 
> 
> On 23.05.2023 10:11, Dan Carpenter wrote:
> > This was allocating "sizeof(qp->intf_clks)" which is the size of a
> > pointer instead of "sizeof(*qp->intf_clks)" which is the size of the
> > struct (8 bytes vs 16 bytes on a 64bit system).
> > 
> > Fixes: 2e2113c8a64f ("interconnect: qcom: rpm: Handle interface clocks")
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Whoops. Guess I was just really really lucky that nothing blew up for me.
> 
> Thanks.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>

Hold up.  Wait...  Let's not apply this.  The bug is more severe than I
saw initially.  It should be:

	qp->intf_clks = devm_kcalloc(dev, cd_num, sizeof(*qp->intf_clks),
				     GFP_KERNEL);

Did we only test with cd_num set to zero?

regards,
dan carpenter





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux