Merge branch 'linux-2.6.30.y' of git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax

+21 -7
+6 -5
net/wimax/op-msg.c
··· 149 } 150 result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg); 151 if (result < 0) { 152 - dev_err(dev, "no memory to add payload in attribute\n"); 153 goto error_nla_put; 154 } 155 genlmsg_end(skb, genl_msg); ··· 300 struct sk_buff *skb; 301 302 skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags); 303 - if (skb == NULL) 304 - goto error_msg_new; 305 - result = wimax_msg_send(wimax_dev, skb); 306 - error_msg_new: 307 return result; 308 } 309 EXPORT_SYMBOL_GPL(wimax_msg);
··· 149 } 150 result = nla_put(skb, WIMAX_GNL_MSG_DATA, size, msg); 151 if (result < 0) { 152 + dev_err(dev, "no memory to add payload (msg %p size %zu) in " 153 + "attribute: %d\n", msg, size, result); 154 goto error_nla_put; 155 } 156 genlmsg_end(skb, genl_msg); ··· 299 struct sk_buff *skb; 300 301 skb = wimax_msg_alloc(wimax_dev, pipe_name, buf, size, gfp_flags); 302 + if (IS_ERR(skb)) 303 + result = PTR_ERR(skb); 304 + else 305 + result = wimax_msg_send(wimax_dev, skb); 306 return result; 307 } 308 EXPORT_SYMBOL_GPL(wimax_msg);
+15 -2
net/wimax/stack.c
··· 338 */ 339 void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) 340 { 341 mutex_lock(&wimax_dev->mutex); 342 - __wimax_state_change(wimax_dev, new_state); 343 mutex_unlock(&wimax_dev->mutex); 344 return; 345 } ··· 389 void wimax_dev_init(struct wimax_dev *wimax_dev) 390 { 391 INIT_LIST_HEAD(&wimax_dev->id_table_node); 392 - __wimax_state_set(wimax_dev, WIMAX_ST_UNINITIALIZED); 393 mutex_init(&wimax_dev->mutex); 394 mutex_init(&wimax_dev->mutex_reset); 395 }
··· 338 */ 339 void wimax_state_change(struct wimax_dev *wimax_dev, enum wimax_st new_state) 340 { 341 + /* 342 + * A driver cannot take the wimax_dev out of the 343 + * __WIMAX_ST_NULL state unless by calling wimax_dev_add(). If 344 + * the wimax_dev's state is still NULL, we ignore any request 345 + * to change its state because it means it hasn't been yet 346 + * registered. 347 + * 348 + * There is no need to complain about it, as routines that 349 + * call this might be shared from different code paths that 350 + * are called before or after wimax_dev_add() has done its 351 + * job. 352 + */ 353 mutex_lock(&wimax_dev->mutex); 354 + if (wimax_dev->state > __WIMAX_ST_NULL) 355 + __wimax_state_change(wimax_dev, new_state); 356 mutex_unlock(&wimax_dev->mutex); 357 return; 358 } ··· 376 void wimax_dev_init(struct wimax_dev *wimax_dev) 377 { 378 INIT_LIST_HEAD(&wimax_dev->id_table_node); 379 + __wimax_state_set(wimax_dev, __WIMAX_ST_NULL); 380 mutex_init(&wimax_dev->mutex); 381 mutex_init(&wimax_dev->mutex_reset); 382 }