[PATCH] taskstats: fix? sk_buff leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Compile tested only, and I know nothing about net/. Needs an ack from
maintainer.

'return genlmsg_cancel()' in taskstats_user_cmd/taskstats_exit_send looks
wrong to me. Unless we pass 'rep_skb' to the netlink layer we own sk_buff,
yes? This means we should always do kfree_skb() on failure.

Signed-off-by: Oleg Nesterov <[email protected]>

--- STATS/kernel/taskstats.c~1_skb	2006-10-29 15:12:51.000000000 +0300
+++ STATS/kernel/taskstats.c	2006-10-29 16:16:05.000000000 +0300
@@ -411,7 +411,7 @@ static int taskstats_user_cmd(struct sk_
 	return send_reply(rep_skb, info->snd_pid);
 
 nla_put_failure:
-	return genlmsg_cancel(rep_skb, reply);
+	genlmsg_cancel(rep_skb, reply);
 err:
 	nlmsg_free(rep_skb);
 	return rc;
@@ -507,7 +507,6 @@ send:
 
 nla_put_failure:
 	genlmsg_cancel(rep_skb, reply);
-	goto ret;
 err_skb:
 	nlmsg_free(rep_skb);
 ret:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux