mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
s390/ctcm: fix potential memory leak
smatch complains about
drivers/s390/net/ctcm_mpc.c:1210 ctcmpc_unpack_skb() warn: possible memory leak of 'mpcginfo'
mpc_action_discontact() did not free mpcginfo. Consolidate the freeing in
ctcmpc_unpack_skb().
Fixes: 293d984f0e ("ctcm: infrastructure for replaced ctc driver")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
2c50c6867c
commit
0c0b20587b
@@ -626,8 +626,6 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
|
|||||||
ctcm_clear_busy_do(dev);
|
ctcm_clear_busy_do(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(mpcginfo);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1192,10 +1190,10 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
|
|||||||
CTCM_FUNTAIL, dev->name);
|
CTCM_FUNTAIL, dev->name);
|
||||||
priv->stats.rx_dropped++;
|
priv->stats.rx_dropped++;
|
||||||
/* mpcginfo only used for non-data transfers */
|
/* mpcginfo only used for non-data transfers */
|
||||||
kfree(mpcginfo);
|
|
||||||
if (do_debug_data)
|
if (do_debug_data)
|
||||||
ctcmpc_dump_skb(pskb, -8);
|
ctcmpc_dump_skb(pskb, -8);
|
||||||
}
|
}
|
||||||
|
kfree(mpcginfo);
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
|
|
||||||
@@ -1977,7 +1975,6 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kfree(mpcginfo);
|
|
||||||
|
|
||||||
CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n",
|
CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n",
|
||||||
__func__, ch->id, grp->outstanding_xid2,
|
__func__, ch->id, grp->outstanding_xid2,
|
||||||
@@ -2038,7 +2035,6 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg)
|
|||||||
mpc_validate_xid(mpcginfo);
|
mpc_validate_xid(mpcginfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kfree(mpcginfo);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user