From patchwork Wed Jul 1 06:53:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 489884 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6EFB41402B9 for ; Wed, 1 Jul 2015 16:54:34 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 547611A0E19 for ; Wed, 1 Jul 2015 16:54:34 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id F1C6A1A09F0 for ; Wed, 1 Jul 2015 16:54:29 +1000 (AEST) Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Jul 2015 16:54:26 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 1 Jul 2015 16:54:25 +1000 X-Helo: d23dlp02.au.ibm.com X-MailFrom: apopple@au1.ibm.com X-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id B4C342BB003F for ; Wed, 1 Jul 2015 16:54:24 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t616sH6e63701044 for ; Wed, 1 Jul 2015 16:54:25 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t616rqtu020488 for ; Wed, 1 Jul 2015 16:53:52 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t616rqSE019888; Wed, 1 Jul 2015 16:53:52 +1000 Received: from localhost (unknown [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id B4B35A01E8; Wed, 1 Jul 2015 16:53:27 +1000 (AEST) From: Alistair Popple To: skiboot@lists.ozlabs.org Date: Wed, 1 Jul 2015 16:53:09 +1000 Message-Id: <1435733589-27295-1-git-send-email-alistair@popple.id.au> X-Mailer: git-send-email 1.8.3.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070106-0021-0000-0000-00000174F854 Subject: [Skiboot] [PATCH] bt: Check before dequeuing messages with ipmi_dequeue_msg X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Popple MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" We will soon expose the dequeue message function which deletes previously queued messages from the message queue. It could help catch a few bugs by doing some extra checks. Signed-off-by: Alistair Popple Reviewed-by: Kamalesh Babulal --- hw/bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/bt.c b/hw/bt.c index 0c89d9f..e81498f 100644 --- a/hw/bt.c +++ b/hw/bt.c @@ -490,7 +490,7 @@ static int bt_del_ipmi_msg(struct ipmi_msg *ipmi_msg) struct bt_msg *bt_msg = container_of(ipmi_msg, struct bt_msg, ipmi_msg); lock(&bt.lock); - list_del(&bt_msg->link); + list_del_from(&bt.msgq, &bt_msg->link); bt.queue_len--; bt_send_and_unlock(); return 0;