summaryrefslogtreecommitdiffstats
path: root/net/dcb/dcbnl.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-02-10 12:57:16 +0100
committerDavid S. Miller <davem@davemloft.net>2011-02-13 20:21:14 +0100
commitd3337de52af7fb0ebe605b02b740be4ee7dee9eb (patch)
tree1788ad68e863e2aa8c6cbf50ceab25d39827bc5b /net/dcb/dcbnl.c
parentnet: dcb: application priority is per net_device (diff)
downloadlinux-d3337de52af7fb0ebe605b02b740be4ee7dee9eb.tar.xz
linux-d3337de52af7fb0ebe605b02b740be4ee7dee9eb.zip
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>
Diffstat (limited to 'net/dcb/dcbnl.c')
-rw-r--r--net/dcb/dcbnl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 712ca026040a..d5074a567289 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;