lkml.org 
[lkml]   [2014]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH][v5] netlink: have netlink per-protocol bind function return an error code.
From
From: Richard Guy Briggs <rgb@redhat.com>
Date: Mon, 24 Mar 2014 16:59:23 -0400

> + if (err)
> + if (!nlk->portid)
> + netlink_remove(sk);
> + for (int undo = 0; undo < i; undo++)
> + if (nlk->netlink_unbind)
> + nlk->netlink_unbind(undo);
> + return err;

Take a good long stare at that code block for a while.

Looks like you forgot the braces to delineate the code block.

This also means you really haven't tested this patch :-)

Please also DO NOT declare local variables in a for() statement,
this is not c++.


\
 
 \ /
  Last update: 2014-03-26 21:21    [W:0.856 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site