aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/unicast.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/batman-adv/unicast.c')
-rw-r--r--drivers/staging/batman-adv/unicast.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/batman-adv/unicast.c b/drivers/staging/batman-adv/unicast.c
index f951abc..0dac50d 100644
--- a/drivers/staging/batman-adv/unicast.c
+++ b/drivers/staging/batman-adv/unicast.c
@@ -78,7 +78,7 @@ void create_frag_entry(struct list_head *head, struct sk_buff *skb)
return;
}
-void create_frag_buffer(struct list_head *head)
+int create_frag_buffer(struct list_head *head)
{
int i;
struct frag_packet_list_entry *tfp;
@@ -86,13 +86,17 @@ void create_frag_buffer(struct list_head *head)
for (i = 0; i < FRAG_BUFFER_SIZE; i++) {
tfp = kmalloc(sizeof(struct frag_packet_list_entry),
GFP_ATOMIC);
+ if (!tfp) {
+ frag_list_free(head);
+ return -ENOMEM;
+ }
tfp->skb = NULL;
tfp->seqno = 0;
INIT_LIST_HEAD(&tfp->list);
list_add(&tfp->list, head);
}
- return;
+ return 0;
}
struct frag_packet_list_entry *search_frag_packet(struct list_head *head,