Skip to content
Permalink
Browse files
net: hns3: Fix uninitialized return from function
Currently function hns3_reset_notify_uninit_enet is returning
the contents of the uninitialized variable ret.  Fix this by
removing ret (since it is no longer used) and replace it with
a return of the literal value 0.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 64749c9 ("net: hns3: remove redundant return value of hns3_uninit_all_ring()")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
  • Loading branch information
Colin Ian King authored and intel-lab-lkp committed Feb 10, 2021
1 parent e0756cf commit e51cd2716c8b5c2ba8daf480c7852c6b2feaac82
Showing 1 changed file with 1 addition and 2 deletions.
@@ -4664,7 +4664,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
{
struct net_device *netdev = handle->kinfo.netdev;
struct hns3_nic_priv *priv = netdev_priv(netdev);
int ret;

if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
netdev_warn(netdev, "already uninitialized\n");
@@ -4688,7 +4687,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)

hns3_put_ring_config(priv);

return ret;
return 0;
}

static int hns3_reset_notify(struct hnae3_handle *handle,

0 comments on commit e51cd27

Please sign in to comment.