From patchwork Thu Aug 3 06:45:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Bur X-Patchwork-Id: 797019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xNLHl2lV2z9s82 for ; Thu, 3 Aug 2017 16:48:51 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xNLHl0nLMzDrYB for ; Thu, 3 Aug 2017 16:48:51 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xNLGH5tyFzDqlS for ; Thu, 3 Aug 2017 16:47:35 +1000 (AEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v736hihi122734 for ; Thu, 3 Aug 2017 02:47:33 -0400 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0b-001b2d01.pphosted.com with ESMTP id 2c3vgcff7x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 03 Aug 2017 02:47:32 -0400 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Aug 2017 16:47:30 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 3 Aug 2017 16:47:27 +1000 Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v736lJT97340214 for ; Thu, 3 Aug 2017 16:47:27 +1000 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v736ks55007325 for ; Thu, 3 Aug 2017 16:46:54 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v736ks2D007038 for ; Thu, 3 Aug 2017 16:46:54 +1000 Received: from camb691.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 5C930A0273 for ; Thu, 3 Aug 2017 16:46:30 +1000 (AEST) From: Cyril Bur To: skiboot@lists.ozlabs.org Date: Thu, 3 Aug 2017 16:45:47 +1000 X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170803064551.3439-1-cyril.bur@au1.ibm.com> References: <20170803064551.3439-1-cyril.bur@au1.ibm.com> X-TM-AS-MML: disable x-cbid: 17080306-0048-0000-0000-000002577B4B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080306-0049-0000-0000-0000480A4569 Message-Id: <20170803064551.3439-8-cyril.bur@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-03_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708030104 Subject: [Skiboot] [PATCH 08/12] hdata/paca: Fix possible dereference of NULL (CID 141080) X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Fixes: CID 141080 Signed-off-by: Cyril Bur Reviewed-by: Vasant Hegde --- hdata/paca.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hdata/paca.c b/hdata/paca.c index eaad0d4d..3d13a5f2 100644 --- a/hdata/paca.c +++ b/hdata/paca.c @@ -153,6 +153,9 @@ static void add_xics_icps(void) continue; intsrv = dt_find_property(cpu, "ibm,ppc-interrupt-server#s"); + if (!intsrv) + continue; + pir = dt_prop_get_u32(cpu, "ibm,pir"); /* Get ibase address */