All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: andreas.noever@gmail.com, michael.jamet@intel.com,
	YehezkelShB@gmail.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thunderbolt: Check for null pointer after calling kmemdup in icm_handle_event
Date: Wed, 5 Jan 2022 12:17:38 +0200	[thread overview]
Message-ID: <YdVwQvoadUC22CVb@lahna> (raw)
In-Reply-To: <20220105082634.2410596-1-jiasheng@iscas.ac.cn>

Hi,

On Wed, Jan 05, 2022 at 04:26:34PM +0800, Jiasheng Jiang wrote:
> As the possible failure of the allocation, kmemdup() may return NULL
> pointer.
> Like alloc_switch(), it might be better to check it.
> Therefore, icm_handle_event() should also check the return value of
> kmemdup().
> If fails, just free 'n' and directly return is enough, same as the way
> to handle the failure of kmalloc().
> 
> Fixes: f67cf491175a ("thunderbolt: Add support for Internal Connection Manager (ICM)")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>

Thanks for the patch but I realized that this has been fixed already:

https://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git/commit/?h=next&id=3cc1c6de458e0e58c413c3c35802ca96e55bbdbe

  reply	other threads:[~2022-01-05 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05  8:26 [PATCH] thunderbolt: Check for null pointer after calling kmemdup in icm_handle_event Jiasheng Jiang
2022-01-05 10:17 ` Mika Westerberg [this message]
2022-01-05 10:21 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YdVwQvoadUC22CVb@lahna \
    --to=mika.westerberg@linux.intel.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michael.jamet@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.