Re: [PATCH] viacam: Don't explode if pci_find_bus() returns NULL

From: Jonathan Corbet
Date: Tue Jul 05 2011 - 10:09:04 EST


On Sun, 3 Jul 2011 09:54:12 +0200 (CEST)
Jesper Juhl <jj@xxxxxxxxxxxxx> wrote:

> In the unlikely case that pci_find_bus() should return NULL
> viacam_serial_is_enabled() is going to dereference a NULL pointer and
> blow up. Better safe than sorry, so be defensive and check the
> pointer.

Extremely unlikely - that function is only called on a single architecture
where the bus is known to exist. Still, no harm can come from checking.

Acked-by: Jonathan Corbet <corbet@xxxxxxx>

Thanks,

jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/