Skip to content

Commit

Permalink
mctp: Fix warnings reported by clang-analyzer
Browse files Browse the repository at this point in the history
net/mctp/device.c:140:11: warning: Assigned value is garbage or undefined
[clang-analyzer-core.uninitialized.Assign]
        mcb->idx = idx;

- Not a real problem due to how the callback runs, fix the warning.

net/mctp/route.c:458:4: warning: Value stored to 'msk' is never read
[clang-analyzer-deadcode.DeadStores]
        msk = container_of(key->sk, struct mctp_sock, sk);

- 'msk' dead assignment can be removed here.

Signed-off-by: Matt Johnston <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mkj authored and davem330 committed Feb 23, 2022
1 parent 3185485 commit 8d78319
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion net/mctp/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int mctp_dump_addrinfo(struct sk_buff *skb, struct netlink_callback *cb)
struct ifaddrmsg *hdr;
struct mctp_dev *mdev;
int ifindex;
int idx, rc;
int idx = 0, rc;

hdr = nlmsg_data(cb->nlh);
// filter by ifindex if requested
Expand Down
1 change: 0 additions & 1 deletion net/mctp/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ static int mctp_route_input(struct mctp_route *route, struct sk_buff *skb)
* the reassembly/response key
*/
if (!rc && flags & MCTP_HDR_FLAG_EOM) {
msk = container_of(key->sk, struct mctp_sock, sk);
sock_queue_rcv_skb(key->sk, key->reasm_head);
key->reasm_head = NULL;
__mctp_key_done_in(key, net, f, MCTP_TRACE_KEY_REPLIED);
Expand Down

0 comments on commit 8d78319

Please sign in to comment.