From patchwork Mon Oct 17 15:05:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 683067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3syM5p3bfHz9s9x for ; Tue, 18 Oct 2016 02:08:14 +1100 (AEDT) Received: from localhost ([::1]:33758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw9WN-0002CM-93 for incoming@patchwork.ozlabs.org; Mon, 17 Oct 2016 11:08:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bw9Ut-0000rJ-75 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 11:06:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bw9Up-0005OA-QY for qemu-devel@nongnu.org; Mon, 17 Oct 2016 11:06:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bw9Up-0005Nw-I8 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 11:06:35 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9HF5cbE105467 for ; Mon, 17 Oct 2016 11:06:34 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0a-001b2d01.pphosted.com with ESMTP id 264y36pnpt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Oct 2016 11:06:34 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Oct 2016 16:06:31 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp08.uk.ibm.com (192.168.101.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Oct 2016 16:06:29 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 69D4F2190023 for ; Mon, 17 Oct 2016 16:05:45 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9HF6SQd59506924 for ; Mon, 17 Oct 2016 15:06:28 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9HE6ToE026852 for ; Mon, 17 Oct 2016 08:06:30 -0600 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9HE6Tdp026849; Mon, 17 Oct 2016 08:06:29 -0600 Received: from bahia.localdomain (sig-9-83-37-45.evts.uk.ibm.com [9.83.37.45]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 1D3952200CB; Mon, 17 Oct 2016 17:06:27 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Mon, 17 Oct 2016 17:05:48 +0200 X-Mailer: git-send-email 2.5.5 In-Reply-To: <1476716754-26686-1-git-send-email-groug@kaod.org> References: <1476716754-26686-1-git-send-email-groug@kaod.org> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101715-0032-0000-0000-00000229B8C1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101715-0033-0000-0000-00001D4CD691 Message-Id: <1476716754-26686-7-git-send-email-groug@kaod.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-17_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=13 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610170265 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PULL 06/12] 9pfs: drop useless check in pdu_free() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Aneesh Kumar K.V" , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Out of the three users of pdu_free(), none ever passes a NULL pointer to this function. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index f2ab1dfab2b2..df8aa726c9a1 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -626,16 +626,14 @@ V9fsPDU *pdu_alloc(V9fsState *s) void pdu_free(V9fsPDU *pdu) { - if (pdu) { - V9fsState *s = pdu->s; - /* - * Cancelled pdu are added back to the freelist - * by flush request . - */ - if (!pdu->cancelled) { - QLIST_REMOVE(pdu, next); - QLIST_INSERT_HEAD(&s->free_list, pdu, next); - } + V9fsState *s = pdu->s; + /* + * Cancelled pdu are added back to the freelist + * by flush request . + */ + if (!pdu->cancelled) { + QLIST_REMOVE(pdu, next); + QLIST_INSERT_HEAD(&s->free_list, pdu, next); } }