···149149 }150150 result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg);151151 if (result < 0) {152152- dev_err(dev, "no memory to add payload in attribute\n");152152+ dev_err(dev, "no memory to add payload (msg %p size %zu) in "153153+ "attribute: %d\n", msg, size, result);153154 goto error_nla_put;154155 }155156 genlmsg_end(skb, genl_msg);···300299 struct sk_buff *skb;301300302301 skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags);303303- if (skb == NULL)304304- goto error_msg_new;305305- result = wimax_msg_send(wimax_dev, skb);306306-error_msg_new:302302+ if (IS_ERR(skb))303303+ result = PTR_ERR(skb);304304+ else305305+ result = wimax_msg_send(wimax_dev, skb);307306 return result;308307}309308EXPORT_SYMBOL_GPL(wimax_msg);
+15-2
net/wimax/stack.c
···338338 */339339void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state)340340{341341+ /*342342+ * A driver cannot take the wimax_dev out of the343343+ * __WIMAX_ST_NULL state unless by calling wimax_dev_add(). If344344+ * the wimax_dev's state is still NULL, we ignore any request345345+ * to change its state because it means it hasn't been yet346346+ * registered.347347+ *348348+ * There is no need to complain about it, as routines that349349+ * call this might be shared from different code paths that350350+ * are called before or after wimax_dev_add() has done its351351+ * job.352352+ */341353 mutex_lock(&wimax_dev->mutex);342342- __wimax_state_change(wimax_dev, new_state);354354+ if (wimax_dev->state > __WIMAX_ST_NULL)355355+ __wimax_state_change(wimax_dev, new_state);343356 mutex_unlock(&wimax_dev->mutex);344357 return;345358}···389376void wimax_dev_init(struct wimax_dev *wimax_dev)390377{391378 INIT_LIST_HEAD(&wimax_dev->id_table_node);392392- __wimax_state_set(wimax_dev, WIMAX_ST_UNINITIALIZED);379379+ __wimax_state_set(wimax_dev, __WIMAX_ST_NULL);393380 mutex_init(&wimax_dev->mutex);394381 mutex_init(&wimax_dev->mutex_reset);395382}