CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Kyle Tso <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Kyle Tso <[email protected]>

Hi Kyle,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v5.11-rc7 next-20210212]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Kyle-Tso/usb-typec-tcpm-Export-partner-Source-Capabilities/20210214-192125
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 
usb-testing
:::::: branch date: 2 hours ago
:::::: commit date: 2 hours ago
config: i386-randconfig-m021-20210214 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/usb/typec/tcpm/tcpm.c:5770 tcpm_get_partner_src_caps() warn: variable 
dereferenced before check 'src_pdo' (see line 5769)

vim +/src_pdo +5770 drivers/usb/typec/tcpm/tcpm.c

bfd31a180a3d55 Kyle Tso 2021-02-14  5754  
bfd31a180a3d55 Kyle Tso 2021-02-14  5755  /*
bfd31a180a3d55 Kyle Tso 2021-02-14  5756   * Don't call this function in 
interrupt context. Caller needs to free the
bfd31a180a3d55 Kyle Tso 2021-02-14  5757   * memory by calling 
tcpm_put_partner_src_caps.
bfd31a180a3d55 Kyle Tso 2021-02-14  5758   */
bfd31a180a3d55 Kyle Tso 2021-02-14  5759  int tcpm_get_partner_src_caps(struct 
tcpm_port *port, u32 **src_pdo)
bfd31a180a3d55 Kyle Tso 2021-02-14  5760  {
bfd31a180a3d55 Kyle Tso 2021-02-14  5761        unsigned int nr_pdo;
bfd31a180a3d55 Kyle Tso 2021-02-14  5762  
bfd31a180a3d55 Kyle Tso 2021-02-14  5763        mutex_lock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14  5764        if (port->nr_source_caps == 0) {
bfd31a180a3d55 Kyle Tso 2021-02-14  5765                
mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14  5766                return -ENODATA;
bfd31a180a3d55 Kyle Tso 2021-02-14  5767        }
bfd31a180a3d55 Kyle Tso 2021-02-14  5768  
bfd31a180a3d55 Kyle Tso 2021-02-14 @5769        *src_pdo = 
kcalloc(port->nr_source_caps, sizeof(u32), GFP_KERNEL);
bfd31a180a3d55 Kyle Tso 2021-02-14 @5770        if (!src_pdo) {
bfd31a180a3d55 Kyle Tso 2021-02-14  5771                
mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14  5772                return -ENOMEM;
bfd31a180a3d55 Kyle Tso 2021-02-14  5773        }
bfd31a180a3d55 Kyle Tso 2021-02-14  5774  
bfd31a180a3d55 Kyle Tso 2021-02-14  5775        nr_pdo = 
tcpm_copy_pdos(*src_pdo, port->source_caps,
bfd31a180a3d55 Kyle Tso 2021-02-14  5776                                
port->nr_source_caps);
bfd31a180a3d55 Kyle Tso 2021-02-14  5777        mutex_unlock(&port->lock);
bfd31a180a3d55 Kyle Tso 2021-02-14  5778        return nr_pdo;
bfd31a180a3d55 Kyle Tso 2021-02-14  5779  }
bfd31a180a3d55 Kyle Tso 2021-02-14  5780  
EXPORT_SYMBOL_GPL(tcpm_get_partner_src_caps);
bfd31a180a3d55 Kyle Tso 2021-02-14  5781  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to