summaryrefslogtreecommitdiff
path: root/net/mctp
diff options
context:
space:
mode:
authorMatt Johnston <matt@codeconstruct.com.au>2022-02-22 07:29:36 +0300
committerJoel Stanley <joel@jms.id.au>2022-03-18 03:38:59 +0300
commitb80fd2a771ad35559434ca0d4bda65490e5740c6 (patch)
treef8626202fddb51965b81e5ed26aa4e5083cffde4 /net/mctp
parent0c6fce90be999b31e6f6f576c38b97f1ae49f8a1 (diff)
downloadlinux-b80fd2a771ad35559434ca0d4bda65490e5740c6.tar.xz
mctp: Fix warnings reported by clang-analyzer
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. OpenBMC-Staging-Count: 1 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 8d783197f06d905e5e7a89342e815ef5aeaa1731) Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'net/mctp')
-rw-r--r--net/mctp/device.c2
-rw-r--r--net/mctp/route.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/net/mctp/device.c b/net/mctp/device.c
index be61fe1dadb0..ff85c09e34ce 100644
--- a/net/mctp/device.c
+++ b/net/mctp/device.c
@@ -119,7 +119,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
diff --git a/net/mctp/route.c b/net/mctp/route.c
index 5078ce3315cf..d5e7db83fe9d 100644
--- a/net/mctp/route.c
+++ b/net/mctp/route.c
@@ -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);