All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Re: [PATCH v2] ide: Check for null pointer after calling devm_ioremap
@ 2022-01-07 11:47 Jiasheng Jiang
  0 siblings, 0 replies; only message in thread
From: Jiasheng Jiang @ 2022-01-07 11:47 UTC (permalink / raw)
  To: David.Laight, damien.lemoal, davem
  Cc: linux-ide, linux-kernel, stable, Jiasheng Jiang

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-07 11:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 11:47 Re: [PATCH v2] ide: Check for null pointer after calling devm_ioremap Jiasheng Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.