Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3xcPd24VL2zDqHD for ; Wed, 23 Aug 2017 08:00:38 +1000 (AEST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7MLx2U3015799 for ; Tue, 22 Aug 2017 18:00:36 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2cgpgb74d9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 22 Aug 2017 18:00:36 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Aug 2017 18:00:35 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 22 Aug 2017 18:00:33 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v7MM0V2e26411170; Tue, 22 Aug 2017 22:00:32 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9200A124050; Tue, 22 Aug 2017 17:57:53 -0400 (EDT) Received: from oc3016140333.ibm.com (unknown [9.41.179.225]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 4E69C12405A; Tue, 22 Aug 2017 17:57:53 -0400 (EDT) From: Eddie James To: openbmc@lists.ozlabs.org Cc: joel@jms.id.au, "Edward A. James" Subject: [PATCH linux dev-4.10] drivers: occ: Fix bad list access Date: Tue, 22 Aug 2017 17:00:30 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17082222-0048-0000-0000-000001D787C6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007593; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000223; SDB=6.00906183; UDB=6.00454164; IPR=6.00686385; BA=6.00005550; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016816; XFM=3.00000015; UTC=2017-08-22 22:00:34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17082222-0049-0000-0000-000042516C2D Message-Id: <1503439230-14034-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-22_08:, , 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-1707230000 definitions=main-1708220336 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Aug 2017 22:00:39 -0000 From: "Edward A. James" list_first_entry() doesn't return NULL if the list is empty... Signed-off-by: Edward A. James --- drivers/fsi/occ.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c index d984e51..621fbf0 100644 --- a/drivers/fsi/occ.c +++ b/drivers/fsi/occ.c @@ -572,7 +572,7 @@ static void occ_worker(struct work_struct *work) again: spin_lock_irq(&occ->list_lock); - xfr = list_first_entry(&occ->xfrs, struct occ_xfr, link); + xfr = list_first_entry_or_null(&occ->xfrs, struct occ_xfr, link); if (!xfr) { spin_unlock_irq(&occ->list_lock); return; -- 1.8.3.1