[bug report] mt76: implement functions to get the response skb for MCU calls

Johannes Berg johannes at sipsolutions.net
Fri Oct 8 07:03:10 PDT 2021


On Fri, 2021-10-08 at 16:00 +0300, Dan Carpenter wrote:
> 
>     1146         ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_ACCESS, &req,
>     1147                                         sizeof(req), true, &skb);
> 
> If mt76_mcu_send_and_get_msg() calls the dev->mcu_ops->mcu_send_msg()
> then "skb" is not initialized.
> 
>     1148         if (ret)
>     1149                 return ret;
>     1150 
> --> 1151         res = (struct mt7921_mcu_eeprom_info *)skb->data;

Looks like possibly 'skb' is always initialized if
mt76_mcu_send_and_get_msg() returns 0 (success)?

But I guess it'd be nicer to write that with ERR_PTR() and actually
*return* the pointer (or ERR_PTR), rather than the output parameter.

johannes




More information about the Linux-mediatek mailing list