[lvm-devel] [PATCH 3/5] Ensure first is not NULL before dereference

Alasdair G Kergon agk at redhat.com
Tue Oct 26 13:52:46 UTC 2010


On Tue, Oct 26, 2010 at 02:59:24PM +0200, Zdenek Kabelac wrote:
> +	if (!first) {
> +		log_error(INTERNAL_ERROR "Unexpected empty PV list.");
> +		return 0;

We already have a 'list empty' check prior to calling this function.

I think it's more readable with the check in the caller and the
comment inside the function, instead of moving the check inside
the function.

No need to change this that I can see.

What is the code path that could trigger this condition?
(It's a static function only called from one place.)

What am I missing?

Alasdair




More information about the lvm-devel mailing list