From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756205AbcHZAmo (ORCPT ); Thu, 25 Aug 2016 20:42:44 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:44749 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751660AbcHZAmm (ORCPT ); Thu, 25 Aug 2016 20:42:42 -0400 Subject: Re: [PATCH] net: hns: dereference ppe_cb->ppe_common_cb if it is non-null To: Colin King , Salil Mehta , "David S . Miller" , Lisheng , References: <20160825065110.10104-1-colin.king@canonical.com> CC: From: Yisen Zhuang Message-ID: <57BF905D.6050304@huawei.com> Date: Fri, 26 Aug 2016 08:42:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160825065110.10104-1-colin.king@canonical.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.157.38] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0206.57BF906F.003D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ba2577601585ad5003f46a0ae5f4c234 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2016/8/25 14:51, Colin King 写道: > 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 Acked-by: Yisen Zhuang