From patchwork Wed Jan 11 10:02:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 41876 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3234173wrt; Wed, 11 Jan 2023 02:11:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXsVsv0PtmHXWFmTYZusegGZoK7BmdMuj1rXBaKA0fexa2VeY8frorwqweW76A201doAVISA X-Received: by 2002:a17:907:6f18:b0:837:3ed3:9c2b with SMTP id sy24-20020a1709076f1800b008373ed39c2bmr68370631ejc.5.1673431868397; Wed, 11 Jan 2023 02:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673431868; cv=none; d=google.com; s=arc-20160816; b=jPD/6GY3V9UefTHzsQ7K/EGh68R/UrDwzf9meQOc457TufslbdL93LYZECQWQspB8F wmc1F/A4zYHaGramIQYRFTsiSlaWcohj6NHdUJwq+ggD2m1lwoHrrQEFEBhh0ZPZejQA TWg/avNl2O3N6SqJ+QPN118flAi2U9AmrSZcCbYt79+7+qmLJQmwF7wkU14N8wAxWcDj Z3+Hv6OlJnFMas24UOQCn6FtyD9YF2n1mRa7ZjDKRuQ/9T2f4VPfyE9Zrk/yjMAkZtaj uVlPZ9gwqqRJkeaVYApsgqvKlELJV5d2qEJ4yDRmKzNNalqQw/LoASH9yuRCwGlIn9/T HS9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=C4ErURr42C3s9JpzlWcVsRw6vxEHPLtj9aAQsvlP4o4=; b=QmU46vUvyYj5dAjDT1Lpw+l+3uSsCY/61LIPxJDljsOC/F4XLf51FbpGS9xNOno3qp DeHtsxAnXd6Sr4Jhxx64bBTbcDi8Jn9/ZkvH6AGF77XvQqVnzuY78lyKsgGTAbZJrhAP t+YQr6zZqlrHfBfjWYWUaPoJVzrjJgNQWL3GxO4NOhYj77j4AZI9amhnC16XGWt9N++W VsUVWPsefvwNkOfLOlvw0kqUREilm1rFyTXf8Xj2hXsMpBgdipOUJ/Vm8Fh/YsdZWUus qxh3raAMwrPrYSKiGc1iVuDqXaxjcATO6DokuhFyYjGnq4j0xdcodbvXl2HUXMsCXzWx ijvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy10-20020a170906fe0a00b007c17f750b75si14381596ejb.796.2023.01.11.02.10.45; Wed, 11 Jan 2023 02:11:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229589AbjAKKGQ (ORCPT + 99 others); Wed, 11 Jan 2023 05:06:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjAKKFQ (ORCPT ); Wed, 11 Jan 2023 05:05:16 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A54BCBD for ; Wed, 11 Jan 2023 02:02:17 -0800 (PST) Received: from dslb-188-096-145-172.188.096.pools.vodafone-ip.de ([188.96.145.172] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pFXvu-0000gP-3P; Wed, 11 Jan 2023 11:02:10 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH] staging: r8188eu: remove NULL check for usb_kill_urb Date: Wed, 11 Jan 2023 11:02:01 +0100 Message-Id: <20230111100201.251905-1-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754720494577677347?= X-GMAIL-MSGID: =?utf-8?q?1754720494577677347?= usb_kill_urb handles a NULL parameter. There's no need for NULL checks before we call usb_kill_urb. Signed-off-by: Martin Kaiser Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c index 62106d2f82ad..583533631133 100644 --- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c +++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c @@ -29,8 +29,7 @@ void rtw_read_port_cancel(struct adapter *padapter) for (i = 0; i < NR_RECVBUFF; i++) { precvbuf->reuse = true; - if (precvbuf->purb) - usb_kill_urb(precvbuf->purb); + usb_kill_urb(precvbuf->purb); precvbuf++; } } @@ -153,15 +152,13 @@ void rtw_write_port_cancel(struct adapter *padapter) padapter->bWritePortCancel = true; for (i = 0; i < NR_XMITBUFF; i++) { - if (pxmitbuf->pxmit_urb) - usb_kill_urb(pxmitbuf->pxmit_urb); + usb_kill_urb(pxmitbuf->pxmit_urb); pxmitbuf++; } pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmit_extbuf; for (i = 0; i < NR_XMIT_EXTBUFF; i++) { - if (pxmitbuf->pxmit_urb) - usb_kill_urb(pxmitbuf->pxmit_urb); + usb_kill_urb(pxmitbuf->pxmit_urb); pxmitbuf++; } }