Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3337de5 authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller
Browse files

Don't potentially dereference NULL in net/dcb/dcbnl.c:dcbnl_getapp()



nla_nest_start() may return NULL. If it does then we'll blow up in
nla_nest_end() when we dereference the pointer.

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7ec79270
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -626,6 +626,9 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
	dcb->cmd = DCB_CMD_GAPP;
	dcb->cmd = DCB_CMD_GAPP;


	app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP);
	app_nest = nla_nest_start(dcbnl_skb, DCB_ATTR_APP);
	if (!app_nest)
		goto out_cancel;

	ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype);
	ret = nla_put_u8(dcbnl_skb, DCB_APP_ATTR_IDTYPE, idtype);
	if (ret)
	if (ret)
		goto out_cancel;
		goto out_cancel;