Re: Re: [PATCH v2] ide: Check for null pointer after calling devm_ioremap

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

 



On Fri, Jan 07, 2022 at 05:28:59PM +0800, David Laight wrote:
> That !!alt_base doesn't look right.
> Without looking at the rest of the code maybe:
> 	if (!base && !alt_base)
> may be correct.

Thanks, that's my fault.
I will correct it.

> It also rather makes me wonder about the actual failure return value.
> If devm_ioport_map() returns a 'port number' for inb()/outb() then
> zero is technically a valid value!

That's not right.
The devm_ioport_map() returns NULL if fails and returns non-NULL
pointer if success.
And also we can find in `drivers/ata/pata_platform.c` that it also
use the same way to check the return value from devm_ioport_map().

I will submit a new version to correct my code.

Sincerely thanks,
Jiang




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux