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

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



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


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