dect
/
linux-2.6
Archived
13
0
Fork 0

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: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jesper Juhl 2011-02-10 11:57:16 +00:00 committed by David S. Miller
parent 7ec79270d7
commit d3337de52a
1 changed files with 3 additions and 0 deletions

View File

@ -626,6 +626,9 @@ static int dcbnl_getapp(struct net_device *netdev, struct nlattr **tb,
dcb->cmd = DCB_CMD_GAPP;
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);
if (ret)
goto out_cancel;