From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753717AbdA3Qwx (ORCPT ); Mon, 30 Jan 2017 11:52:53 -0500 Received: from mga06.intel.com ([134.134.136.31]:4481 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752278AbdA3Qwl (ORCPT ); Mon, 30 Jan 2017 11:52:41 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,312,1477983600"; d="scan'208";a="928228544" Date: Mon, 30 Jan 2017 22:19:54 +0530 From: Vinod Koul To: Shailendra Verma Cc: Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, p.shailesh@samsung.com, ashish.kalra@samsung.com, Shailendra Verma Subject: Re: [PATCH] Dma - Fix possible NULL derefrence. Message-ID: <20170130164954.GE19244@localhost> References: <1485516359-4232-1-git-send-email-shailendra.v@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1485516359-4232-1-git-send-email-shailendra.v@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 27, 2017 at 04:55:59PM +0530, Shailendra Verma wrote: > of_match_device could return NULL, and so cause a NULL > pointer dereference later. Why is this tagged Dma - .... Please look at he git log for the file before coming up with random tags Worst part, this patch fails to apply, so which was this generated against? > > Signed-off-by: Shailendra Verma > --- > drivers/dma/mv_xor.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c > index 23f7528..c25b3bb 100644 > --- a/drivers/dma/mv_xor.c > +++ b/drivers/dma/mv_xor.c > @@ -1323,7 +1323,10 @@ static int mv_xor_probe(struct platform_device *pdev) > const struct of_device_id *of_id = > of_match_device(mv_xor_dt_ids, > &pdev->dev); > + if (!of_id) { > + dev_err(&pdev->dev, "Error: No device match found\n"); > + return -ENODEV; > + } > xordev->xor_type = (uintptr_t)of_id->data; > } > > -- > 1.7.9.5 > -- ~Vinod