Skip to content
  • Oleg Nesterov's avatar
    [PATCH] taskstats: cleanup reply assembling · 37167485
    Oleg Nesterov authored
    
    
    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: default avatarOleg Nesterov <oleg@tv-sign.ru>
    Cc: Thomas Graf <tgraf@suug.ch>
    Cc: Shailabh Nagar <nagar@watson.ibm.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: Jay Lan <jlan@sgi.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    37167485