[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225071408.gbrnwkr7q5kcj33v@kili.mountain>
Date: Tue, 25 Feb 2020 10:14:08 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: netdev@...r.kernel.org
Cc: tgraf@...g.ch
Subject: [bug report] dcbnl: Shorten all command handling functions
The patch 7be994138b18: "dcbnl: Shorten all command handling
functions" from Jun 13, 2012, leads to the following static checker
warning:
net/dcb/dcbnl.c:1509 dcbnl_ieee_set()
warn: passing signed to unsigned: 'err'
net/dcb/dcbnl.c
1491 continue;
1492
1493 if (nla_len(attr) < sizeof(struct dcb_app)) {
1494 err = -ERANGE;
1495 goto err;
1496 }
1497
1498 app_data = nla_data(attr);
1499 if (ops->ieee_setapp)
1500 err = ops->ieee_setapp(netdev, app_data);
1501 else
1502 err = dcb_ieee_setapp(netdev, app_data);
1503 if (err)
1504 goto err;
"err" is negative error codes.
1505 }
1506 }
1507
1508 err:
1509 err = nla_put_u8(skb, DCB_ATTR_IEEE, err);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It's not clear what this is doing but it truncates "err" to a u8 and
sets err to zero.
1510 dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_SET, seq, 0);
1511 return err;
1512 }
There is a similar one at the end of dcbnl_ieee_del() as well. I've no
idea how to fix this.
regards,
dan carpenter
Powered by blists - more mailing lists