From patchwork Mon Feb 6 20:17:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 53492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2447698wrn; Mon, 6 Feb 2023 12:34:19 -0800 (PST) X-Google-Smtp-Source: AK7set86bqjLzKF9vhI566ln1SGwxqOXDr1jj0vBeA8/vaKlYcxUaCLFC/iW9xsXgfUh8UmWn4dD X-Received: by 2002:a17:907:a41e:b0:8a9:4d68:12df with SMTP id sg30-20020a170907a41e00b008a94d6812dfmr123074ejc.38.1675715659632; Mon, 06 Feb 2023 12:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675715659; cv=none; d=google.com; s=arc-20160816; b=Cw1Fnvzm1ptLxdgk4e/W7Pp+tRdTJds4JnSfeAnlTO7n2VJL6QKJisZi0ke4ZF3sWz /NxdJWw8cDGHkEdJGzEuPoMqdBH9mL1y/t8znWEjKQIUD3He4fa3UpwGnkul17hhTow/ RRY0UtYzzRx2Jvg6/vLnxpN0U0DqjdHFnqzaJC0y6wopsjU0IASVRHXspgujeV31/nzf a4Fz5FW41OUkS4AqExCHxX33fVmz52k3g7GUD28Dl8ShY/el++tbd4yBEgGlSq189W78 naaheadVovfQfZnjB4C+BRIb4i/UCAV5fxH1bvX7IUItBB7py03+NSYUNjSXy/ORZtZx xHnQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TCnVBxMA17vDN2dIs1WsM9+Ar3LCRry9ct2YS3y1cu0=; b=FlVTozPkOGFRVtwALf5JkGV2aPYFPK3sSCOYsq5PPcTVeUsqRiGE1C9j4Bi8s6ebuL 7V2WUIAfw4e5eanQeXhu4I3wmfb4BD2QbnjEUzZyb0UExClhDCNNNb28CeVFWQSlNnwQ lAcJLcl13yuJ3bswjxBr5y6HCgFWfT047/gcGr5rI0Xq8c7ReNvBQpe4q9rTT2/njqFO +4znWAj0K87h/KzQ5uZAmURqFpjm/WhSzyZOwkB9zAtrlL4nbr7Uyb5uTZDRNrYQSxTi i6M5tPFb7lmC3RSaaBGJwh7Gn22t9cL2LB1t1c1mTVNMxMSI9wO5ACKhZ8HHY9L6Vfnc 6OWw== 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 vl16-20020a17090730d000b00870b0d90078si13273447ejb.644.2023.02.06.12.33.47; Mon, 06 Feb 2023 12:34:19 -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 S229841AbjBFUTB (ORCPT + 99 others); Mon, 6 Feb 2023 15:19:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbjBFUSf (ORCPT ); Mon, 6 Feb 2023 15:18:35 -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 0724E27D4A for ; Mon, 6 Feb 2023 12:18:17 -0800 (PST) Received: from ipservice-092-217-084-033.092.217.pools.vodafone-ip.de ([92.217.84.33] 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 1pP7wJ-0007ps-9E; Mon, 06 Feb 2023 21:18:11 +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 5/6] staging: r8188eu: handle rtl8188eu_inirp_init errors Date: Mon, 6 Feb 2023 21:17:59 +0100 Message-Id: <20230206201800.139195-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230206201800.139195-1-martin@kaiser.cx> References: <20230206201800.139195-1-martin@kaiser.cx> 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?1757115223553747806?= X-GMAIL-MSGID: =?utf-8?q?1757115223553747806?= The rtl8188eu_inirp_init returns 0 for success or a negative error code. Handle this return value in the two places where rtl8188eu_inirp_init is called. Suggested-by: Pavel Skripkin Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/os_dep/os_intfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index e48dbdfefedb..bd3c17f580c8 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -631,7 +631,8 @@ static int _netdev_open(struct net_device *pnetdev) pr_info("can't init mlme_ext_priv\n"); goto netdev_open_error; } - rtl8188eu_inirp_init(padapter); + if (rtl8188eu_inirp_init(padapter)) + goto netdev_open_error; rtw_led_control(padapter, LED_CTL_NO_LINK); @@ -683,7 +684,8 @@ static int ips_netdrv_open(struct adapter *padapter) if (status == _FAIL) goto netdev_open_error; - rtl8188eu_inirp_init(padapter); + if (rtl8188eu_inirp_init(padapter)) + goto netdev_open_error; rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv); _set_timer(&padapter->mlmepriv.dynamic_chk_timer, 5000);