lkml.org 
[lkml]   [2008]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/3] block: fix add_partition() error path
    Partition stats structure was not freed on devt allocation failure
    path. Fix it.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    ---
    fs/partitions/check.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    Index: work/fs/partitions/check.c
    ===================================================================
    --- work.orig/fs/partitions/check.c
    +++ work/fs/partitions/check.c
    @@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk,

    err = blk_alloc_devt(p, &devt);
    if (err)
    - goto out_free;
    + goto out_free_stats;
    pdev->devt = devt;

    /* delay uevent until 'holders' subdir is created */
    @@ -426,6 +426,8 @@ int add_partition(struct gendisk *disk,

    return 0;

    +out_free_stats:
    + free_part_stats(p);
    out_free:
    kfree(p);
    return err;

    \
     
     \ /
      Last update: 2008-11-10 07:31    [W:5.052 / U:0.504 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site