From: Jeff Garzik Date: Tue, 3 Oct 2006 08:13:52 +0000 (-0700) Subject: [PATCH] fs/eventpoll: error handling micro-cleanup X-Git-Tag: v2.6.19-rc1~358 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3b6571384024be31e8b3442c0e7c3b127110d9b;p=linux-2.6 [PATCH] fs/eventpoll: error handling micro-cleanup While reviewing the 'may be used uninitialized' bogus gcc warnings, I noticed that an error code assignment was only needed if an error had actually occured. Signed-off-by: Jeff Garzik Cc: Davide Libenzi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 8d544334bc..557d5b614f 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -720,9 +720,10 @@ static int ep_getfd(int *efd, struct inode **einode, struct file **efile, /* Allocates an inode from the eventpoll file system */ inode = ep_eventpoll_inode(); - error = PTR_ERR(inode); - if (IS_ERR(inode)) + if (IS_ERR(inode)) { + error = PTR_ERR(inode); goto eexit_2; + } /* Allocates a free descriptor to plug the file onto */ error = get_unused_fd();