lkml.org 
[lkml]   [2004]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [PATCH] Driver Core patches for 2.6.6
    Date
    From
    ChangeSet 1.1587.5.20, 2004/05/05 14:40:43-07:00, greg@kroah.com

    Driver core: handle error if we run out of memory in kmap code


    drivers/base/map.c | 7 +++++++
    1 files changed, 7 insertions(+)


    diff -Nru a/drivers/base/map.c b/drivers/base/map.c
    --- a/drivers/base/map.c Fri May 14 15:57:59 2004
    +++ b/drivers/base/map.c Fri May 14 15:57:59 2004
    @@ -138,6 +138,13 @@
    struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL);
    struct probe *base = kmalloc(sizeof(struct probe), GFP_KERNEL);
    int i;
    +
    + if ((p == NULL) || (base == NULL)) {
    + kfree(p);
    + kfree(base);
    + return NULL;
    + }
    +
    memset(base, 0, sizeof(struct probe));
    base->dev = 1;
    base->range = ~0;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:03    [W:0.020 / U:0.648 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site