On 05/22/15 13:33, Nicholas Krause wrote:
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index ad9eed7..44a8995 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -400,7 +400,7 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, struct nlattr *ta } rtab = kmalloc(sizeof(*rtab), GFP_KERNEL); - if (rtab) { + if (!rtab) { rtab->rate = *r; rtab->refcnt = 1; memcpy(rtab->data, nla_data(tab), 1024);
Did i miss something so clever it is not obvious? ;-> If rtab's kmalloc fails you want to set rtab's fields? And what is wrong with returning a null rtab again? cheers, jamal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html