Re: [PATCH] phy: qcom-m31: Fix error code in probe()

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

 



On Thu, Sep 07, 2023 at 09:53:36PM +0530, Deepak R Varma wrote:
> On Thu, 2023-09-07 at 12:54 +0300, Dan Carpenter wrote:
> > This accidentally returns the wrong variable.  It should be "qphy-
> > >vreg"
> > instead of "qphy->phy".
> 
> Hi Dan,
> Just curious: How did you find this? Visual catch or Static Analyzer?
> 

This was from a Smatch warning.

$ ~/smatch/smatch_scripts/kchecker drivers/phy/qualcomm/phy-qcom-m31.c
  CHECK   scripts/mod/empty.c
  CALL    scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  CC      drivers/phy/qualcomm/phy-qcom-m31.o
  CHECK   drivers/phy/qualcomm/phy-qcom-m31.c
drivers/phy/qualcomm/phy-qcom-m31.c:175 m31usb_phy_init() warn: variable dereferenced before check 'qphy->vreg' (see line 167)
drivers/phy/qualcomm/phy-qcom-m31.c:259 m31usb_phy_probe() warn: passing a valid pointer to 'PTR_ERR'
$

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