Re: [PATCH net v2] mctp i2c: handle NULL header address

From: kernel test robot
Date: Mon Oct 21 2024 - 20:05:19 EST


Hi Matt,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cb560795c8c2ceca1d36a95f0d1b2eafc4074e37]

url: https://github.com/intel-lab-lkp/linux/commits/Matt-Johnston/mctp-i2c-handle-NULL-header-address/20241021-123741
base: cb560795c8c2ceca1d36a95f0d1b2eafc4074e37
patch link: https://lore.kernel.org/r/20241021-mctp-i2c-null-dest-v2-1-4503e478517c%40codeconstruct.com.au
patch subject: [PATCH net v2] mctp i2c: handle NULL header address
config: arc-allmodconfig (https://download.01.org/0day-ci/archive/20241022/202410220730.90gh2nXQ-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241022/202410220730.90gh2nXQ-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410220730.90gh2nXQ-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/net/mctp/mctp-i2c.c: In function 'mctp_i2c_header_create':
>> drivers/net/mctp/mctp-i2c.c:599:23: warning: assignment to 'u8' {aka 'unsigned char'} from 'const unsigned char *' makes integer from pointer without a cast [-Wint-conversion]
599 | llsrc = dev->dev_addr;
| ^

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GET_FREE_REGION
Depends on [n]: SPARSEMEM [=n]
Selected by [m]:
- RESOURCE_KUNIT_TEST [=m] && RUNTIME_TESTING_MENU [=y] && KUNIT [=m]


vim +599 drivers/net/mctp/mctp-i2c.c

579
580 static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev,
581 unsigned short type, const void *daddr,
582 const void *saddr, unsigned int len)
583 {
584 struct mctp_i2c_hdr *hdr;
585 struct mctp_hdr *mhdr;
586 u8 lldst, llsrc;
587
588 if (len > MCTP_I2C_MAXMTU)
589 return -EMSGSIZE;
590
591 if (daddr)
592 lldst = *((u8 *)daddr);
593 else
594 return -EINVAL;
595
596 if (saddr)
597 llsrc = *((u8 *)saddr);
598 else
> 599 llsrc = dev->dev_addr;
600
601 skb_push(skb, sizeof(struct mctp_i2c_hdr));
602 skb_reset_mac_header(skb);
603 hdr = (void *)skb_mac_header(skb);
604 mhdr = mctp_hdr(skb);
605 hdr->dest_slave = (lldst << 1) & 0xff;
606 hdr->command = MCTP_I2C_COMMANDCODE;
607 hdr->byte_count = len + 1;
608 hdr->source_slave = ((llsrc << 1) & 0xff) | 0x01;
609 mhdr->ver = 0x01;
610
611 return sizeof(struct mctp_i2c_hdr);
612 }
613

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki