Acked-by: Ethan Jackson <[email protected]>
On Thu, Jan 24, 2013 at 2:44 PM, Ben Pfaff <[email protected]> wrote: > It's unlikely to fail but checking it can't hurt. > > Found by Coverity. > > Signed-off-by: Ben Pfaff <[email protected]> > --- > lib/netdev-linux.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c > index 433d168..a1ddbe4 100644 > --- a/lib/netdev-linux.c > +++ b/lib/netdev-linux.c > @@ -4586,7 +4586,11 @@ af_packet_sock(void) > if (sock == INT_MIN) { > sock = socket(AF_PACKET, SOCK_RAW, 0); > if (sock >= 0) { > - set_nonblocking(sock); > + int error = set_nonblocking(sock); > + if (error) { > + close(sock); > + sock = -error; > + } > } else { > sock = -errno; > VLOG_ERR("failed to create packet socket: %s", strerror(errno)); > -- > 1.7.2.5 > > _______________________________________________ > dev mailing list > [email protected] > http://openvswitch.org/mailman/listinfo/dev _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
