From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753079AbcHZSpr (ORCPT ); Fri, 26 Aug 2016 14:45:47 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:59587 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbcHZSpp (ORCPT ); Fri, 26 Aug 2016 14:45:45 -0400 Date: Fri, 26 Aug 2016 11:45:44 -0700 (PDT) Message-Id: <20160826.114544.331469797150439600.davem@davemloft.net> To: colin.king@canonical.com Cc: yisen.zhuang@huawei.com, salil.mehta@huawei.com, lisheng011@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: hns: dereference ppe_cb->ppe_common_cb if it is non-null From: David Miller In-Reply-To: <20160825065110.10104-1-colin.king@canonical.com> References: <20160825065110.10104-1-colin.king@canonical.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 26 Aug 2016 11:45:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin King Date: Thu, 25 Aug 2016 07:51:10 +0100 > From: Colin Ian King > > ppe_cb->ppe_common_cb is being dereferenced before a null check is > being made on it. If ppe_cb->ppe_common_cb is null then we end up > with a null pointer dereference when assigning dsaf_dev. Fix this > by moving the initialisation of dsaf_dev once we know > ppe_cb->ppe_common_cb is OK to dereference. > > Signed-off-by: Colin Ian King Applied.