From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Mierswa Date: Mon, 17 Aug 2009 21:13:19 +0000 Subject: Re: [PATCH] Don't compare a non-existing function with NULL Message-Id: <4A89C7EF.9010905@impulze.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------050901050300070802020105" List-Id: References: <4A896707.6010507@impulze.org> In-Reply-To: <4A896707.6010507@impulze.org> To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------050901050300070802020105 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Alan Jenkins wrote: > nak. The intention would have been to catch an "out of memory error" > when allocating devpaths. It should make sense if you replace "index" > with "devpaths" on that line instead, done New patch attached. --------------050901050300070802020105 Content-Type: text/plain; name="0001-Don-t-compare-a-non-existing-function-with-NULL.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-Don-t-compare-a-non-existing-function-with-NULL.patch" >From 52311df17535588c767e64be55116c8f5f14c473 Mon Sep 17 00:00:00 2001 From: Daniel Mierswa Date: Mon, 17 Aug 2009 14:59:26 +0200 Subject: [PATCH] Don't compare a non-existing function with NULL Obviously someone forgot something here or didn't use -ansi. Either way, index is nowhere declared so I assume the current behaviour is to check against the index() function coming from somewhere in the POSIX headers. The comparison doesn't make sense then. Signed-off-by: Daniel Mierswa --- libudev/libudev-queue-private.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c index 0427b65..4dea4ad 100644 --- a/libudev/libudev-queue-private.c +++ b/libudev/libudev-queue-private.c @@ -158,7 +158,7 @@ static struct queue_devpaths *build_index(struct udev_queue_export *udev_queue_e return NULL; } devpaths = calloc(1, sizeof(struct queue_devpaths) + (range + 1) * sizeof(long)); - if (index == NULL) + if (devpaths == NULL) return NULL; devpaths->devpaths_size = range + 1; -- 1.6.4 --------------050901050300070802020105--