From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932606AbdC2Szq (ORCPT ); Wed, 29 Mar 2017 14:55:46 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:45767 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138AbdC2Sy5 (ORCPT ); Wed, 29 Mar 2017 14:54:57 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH][bluetooth-next][V2] ieee802154: ca8210: Add checks for kmalloc allocation failures From: Marcel Holtmann In-Reply-To: <20170329170540.21011-1-colin.king@canonical.com> Date: Wed, 29 Mar 2017 20:54:53 +0200 Cc: Harry Morris , linuxdev@cascoda.com, Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <80D11AF4-0CD7-4FEE-AF17-AD79FBFBD294@holtmann.org> References: <20170329170540.21011-1-colin.king@canonical.com> To: Colin King X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Colin, > Ensure we don't end up with a null pointer dereferences by checking > for for allocation failures. Allocate by sizeof(*ptr) rather than > the type to fix checkpack warnings. Also merge multiple lines into > one line for the kmalloc call. > > Detected by CoverityScan, CID#1422435 ("Dereference null return value") > > Signed-off-by: Colin Ian King > --- > drivers/net/ieee802154/ca8210.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel