From: Jesper Juhl Date: Thu, 10 Feb 2011 11:57:16 +0000 (+0000) Subject: Don't potentially dereference NULL in net/dcb/dcbnl.c:dcbnl_getapp() X-Git-Tag: upstream/snapshot3+hdmi~11431^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3337de52af7fb0ebe605b02b740be4ee7dee9eb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: David S. Miller --- diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 712ca02..d5074a5 100644 --- a/net/dcb/dcbnl.c +++ b/net/dcb/dcbnl.c @@ -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;