Re: [PATCH] Don't compare a non-existing function with NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/17/09, Daniel Mierswa <impulze@xxxxxxxxxxx> wrote:
>
> Obviously someone forgot something here or didn't use -ansi.

Guilty as charged.

> 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.

 	devpaths = calloc(1, sizeof(struct queue_devpaths) + (range + 1) *
sizeof(long));
-	if (index == NULL)
-		return NULL;
 	devpaths->devpaths_size = range + 1;

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,

Thanks for spotting this
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux