* [bug report] net: hns3: add log for setting tx spare buf size
@ 2022-04-22 15:46 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-04-22 15:46 UTC (permalink / raw)
To: chenhao288; +Cc: kernel-janitors
Hello Hao Chen,
This is a semi-automatic email about new static checker warnings.
The patch 2373b35c24ff: "net: hns3: add log for setting tx spare buf
size" from Apr 19, 2022, leads to the following Smatch complaint:
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c:1919 hns3_set_tunable()
error: we previously assumed 'priv->ring->tx_spare' could be null (see line 1904)
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
1903 if (ret ||
1904 (!priv->ring->tx_spare && new_tx_spare_buf_size != 0)) {
^^^^^^^^^^^^^^^^^^^^^
Assume priv->ring->tx_spare is NULL but new_tx_spare_buf_size is non-zero.
1905 int ret1;
1906
1907 netdev_warn(netdev, "change tx spare buf size fail, revert to old value\n");
1908 ret1 = hns3_set_tx_spare_buf_size(netdev,
1909 old_tx_spare_buf_size);
1910 if (ret1) {
1911 netdev_err(netdev, "revert to old tx spare buf size fail\n");
1912 return ret1;
1913 }
1914
1915 return ret;
1916 }
1917
1918 netdev_info(netdev, "the actvie tx spare buf size is %u, due to page order\n",
1919 priv->ring->tx_spare->len);
^^^^^^^^^^^^^^^^^^^^^^
Unchecked dereference.
1920
1921 break;
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-22 15:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 15:46 [bug report] net: hns3: add log for setting tx spare buf size Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.