Re: [patch] PM / Hibernate: NULL dereferences on error paths

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

 



On Sat, Oct 08, 2011 at 09:28:48PM +1100, Bojan Smojver wrote:
> +out_clean:
> +	if (data) {
> +		for (thr = 0; thr < nr_threads; thr++) {
> +			if (data[thr].thr)
> +				kthread_stop(data[thr].thr);
> +		}
> +		vfree(data);
> +	}
> +	if (page) free_page((unsigned long)page);
>  

This obviously works, but why don't you use a normal kernel unwind
style?  You tried this complicated error handling before and it
already caused bugs...  It's simpler if the error handling code has
no if statements.

regards,
dan carpenter

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


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux