[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47BB6DAB.5050506@keyaccess.nl>
Date: Wed, 20 Feb 2008 01:00:43 +0100
From: Rene Herman <rene.herman@...access.nl>
To: Adrian Bunk <bunk@...nel.org>
CC: ambx1@....rr.com, linux-kernel@...r.kernel.org,
Bjorn Helgaas <bjorn.helgaas@...com>
Subject: Re: pnp_bus_resume(): inconsequent NULL checking
On 19-02-08 23:49, Adrian Bunk wrote:
> The Coverity checker spotted the following inconsequent NULL checking
> introduced by commit 5d38998ed15b31f524bde9a193d60150af30d916:
>
> <-- snip -->
>
> ...
> static int pnp_bus_resume(struct device *dev)
> {
> ...
> if (pnp_dev->protocol && pnp_dev->protocol->resume)
> pnp_dev->protocol->resume(pnp_dev);
>
> if (pnp_can_write(pnp_dev)) {
> ...
>
> <-- snip -->
>
> pnp_can_write(pnp_dev) dereferences pnp_dev->protocol.
I see, thanks. pnp_bus_suspend() has the same problem (I added this test to
complete the mirror in fact) and/but is not a real problem since the tests
are also the first things done inside the blocks they protect -- if
pnp_dev->protocol isn't set here, we're dead anyway therefore.
That probably means we can just delete the pnp_dev->protocol tests but this
would need an ack from for example Bjorn Helgaas who might have an idea
about how generically useful this is designed to be. The no brain thing to
do would be just as per attached.
Bjorn?
View attachment "coverity-pnp_bus_suspend_resume.diff" of type "text/plain" (1682 bytes)
Powered by blists - more mailing lists