Re: [PATCH 7/7] blktrace: avoid accessing NULL bdev->bd_disk

From: Arnaldo Carvalho de Melo
Date: Fri Mar 20 2009 - 09:09:23 EST


Em Fri, Mar 20, 2009 at 09:49:48AM +0800, Li Zefan escreveu:
> bdev->bd_disk can be NULL, if the block device is not opened.
>
> Try this against an unmounted partition, and you'll see NULL dereference:
> # echo 1 > /sys/block/sda/sda5/enable
>
> Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>

I guess this can be discounted on my block layer newbeeness 8)

But as an extra check in non hot-paths are usually a good thing...

Acked-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

- Arnaldo
--
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/