lkml.org 
[lkml]   [2010]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/1] DVB-USB: gp8psk, fix potential null derefernce
    Date
    Stanse found that in gp8psk_load_bcm4500fw there is missing a check for
    return value of kmalloc. Add one and bail out appropriatelly.

    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Cc: Alan Nisota <alannisota@gmail.com>
    Cc: Patrick Boettcher <pb@linuxtv.org>
    Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
    ---
    drivers/media/dvb/dvb-usb/gp8psk.c | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

    diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c
    index afb444d..45106ac 100644
    --- a/drivers/media/dvb/dvb-usb/gp8psk.c
    +++ b/drivers/media/dvb/dvb-usb/gp8psk.c
    @@ -105,6 +105,10 @@ static int gp8psk_load_bcm4500fw(struct dvb_usb_device *d)

    ptr = fw->data;
    buf = kmalloc(64, GFP_KERNEL | GFP_DMA);
    + if (!buf) {
    + ret = -ENOMEM;
    + goto out_rel_fw;
    + }

    while (ptr[0] != 0xff) {
    u16 buflen = ptr[0] + 4;
    --
    1.7.0.1



    \
     
     \ /
      Last update: 2010-03-16 15:57    [W:0.024 / U:29.492 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site