X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=net%2Fdcb%2Fdcbnl.c;h=d5074a5672899a9d85adf0f20b363533fa8db9b5;hb=638691a7a46a4ae9a7b56c603299e42d7f6e722e;hp=6b03f561caecfdd72c1fc0df2785c435acdb3cc4;hpb=b8f049ae5593255e42179baa0ce726ae7fdfb30a;p=mv-sheeva.git diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c index 6b03f561cae..d5074a56728 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; @@ -1613,6 +1616,10 @@ EXPORT_SYMBOL(dcb_getapp); u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) { struct dcb_app_type *itr; + struct dcb_app_type event; + + memcpy(&event.name, dev->name, sizeof(event.name)); + memcpy(&event.app, new, sizeof(event.app)); spin_lock(&dcb_lock); /* Search for existing match and replace */ @@ -1644,7 +1651,7 @@ u8 dcb_setapp(struct net_device *dev, struct dcb_app *new) } out: spin_unlock(&dcb_lock); - call_dcbevent_notifiers(DCB_APP_EVENT, new); + call_dcbevent_notifiers(DCB_APP_EVENT, &event); return 0; } EXPORT_SYMBOL(dcb_setapp);