lkml.org 
[lkml]   [2009]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 7/7] blktrace: avoid accessing NULL bdev->bd_disk
    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@cn.fujitsu.com>

    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@redhat.com>

    - Arnaldo


    \
     
     \ /
      Last update: 2009-03-20 14:11    [W:0.022 / U:128.044 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site