lkml.org 
[lkml]   [2018]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RESEND][PATCH 2/4] NFC: st21nfca: Fix memory OOB and leak issues in connectivity events handler
    From
    Date
    On Wed, 2018-04-18 at 15:35 +0530, Amit Pundir wrote:

    > if (skb->data[transaction->aid_len + 2] !=
    > - NFC_EVT_TRANSACTION_PARAMS_TAG)
    > + NFC_EVT_TRANSACTION_PARAMS_TAG ||
    > + skb->len < transaction->aid_len + transaction-
    > >params_len + 4) {

    > + devm_kfree(dev, transaction);

    Oh, no.

    This is not memory leak per se, this is bad choice of devm_ API where it
    should use plain kmalloc() / kfree().

    > return -EPROTO;
    > + }

    --
    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Intel Finland Oy

    \
     
     \ /
      Last update: 2018-04-20 14:39    [W:3.384 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site