Files
erofs-linux/kernel
Oleg Nesterov 3716748530 [PATCH] taskstats: cleanup reply assembling
Thomas Graf wrote:
>
> nla_nest_start() may return NULL, either rely on prepare_reply() to be
> correct and BUG() on failure or do proper error handling for all
> functions.

nla_put() in taskstat.c can fail only if the 'size' argument of alloc_skb()
was not right. This is a kernel bug, we should not hide it. So add 'BUG()'
on error path and check for 'na == NULL'.

> genlmsg_cancel() is only required in error paths for dumping
> procedures.

So we can remove 'genlmsg_cancel()' calls and 'void *reply' (saves 227 bytes).

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Thomas Graf <[email protected]>
Cc: Shailabh Nagar <[email protected]>
Cc: Balbir Singh <[email protected]>
Cc: Jay Lan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07 08:39:34 -08:00
..
…
…
…
2006-12-07 08:39:25 -08:00
…
…
…
…
…
…
…
…
2006-12-04 02:00:22 -05:00
…
2006-12-04 02:00:22 -05:00
…
…
…
…
2006-12-07 08:39:25 -08:00
2006-11-03 12:27:58 -08:00
…
2006-11-22 14:57:56 +00:00
…
…
…
2006-12-07 08:39:32 -08:00
…
…
…
…
…
…
2006-12-07 08:39:25 -08:00
…
…