Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8123752rwi; Tue, 25 Oct 2022 02:49:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qQTjEY2qOFQiQYNWUHoIIdPfqkl8y0ctxhE1sOTx4u37RMcpKWz9r+twr24oFl4DeZsSy X-Received: by 2002:a17:907:1dde:b0:78d:9725:cc69 with SMTP id og30-20020a1709071dde00b0078d9725cc69mr32424280ejc.305.1666691369781; Tue, 25 Oct 2022 02:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666691369; cv=none; d=google.com; s=arc-20160816; b=woXzOpZ0dMVFt2abfLouulZ6hCok0nE6NUcASaawQPEvvU2XF2eueYHbfI20WjpsYY Ea8xeIYizSw5qS9K+zAa+GHiVRli/ftoSjoo8I0lkaiJwuVN6oOk7ViBJs0VlYa9aTl4 POlv3PJOILv07Hd5huZtIU5HCklEjzAop7UymDkzj1CKGSmnECd7UXPJhNI+jsApCeGT plikc2iWvRIBwU77LTxXvKF8KhIhrgKZom86vRHJjJuxdN0kc6PXDH0mrZzddMidrCH2 JsXKRcD8H2BI5SEOEykth2N16C3/pufHDcBANaYz8B6tm3/44YxygA+sr6KkOMaFh+uA zBUw== 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 :dkim-signature; bh=eiyKXU5FxcBo4aQqXip+DivTGxVo/DuU5b7lG8hm9nY=; b=ANurst+Wus97blj6ZSqZBOwPWAAvrryqy1iNnEaUI2oDzJ+VXJ2ROAoPH6xgVCdgh8 +Z9VzgMRJT3wydoYEqYUXN4t2iSLiQrzM4tEjlU+ZtJVyjaWX2ltiHRORpSrsoy3Q/ld khNvRvbDiyfKDZ1D9z/7wM0R7CzIgiDjFe9IEOCUbPn81kdIlPfUr3Q1ZyRx41bQ0My+ Q3T+umIMk66uwbq1uiPBsgLJ6NDzZRX/uCsMD3GEJr2ZVq8s/HvXjmFrd9rlpyf5mO4Y V7CFCg5amVgbYf5MbRkCo19SKLqJxzQHD55NrnjoXj0P9YeOttmVHzFqrHecJmWB7US8 SB6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N+hlx+k2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs13-20020a0564020c4d00b0045c93142111si2132184edb.70.2022.10.25.02.49.04; Tue, 25 Oct 2022 02:49:29 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=N+hlx+k2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232356AbiJYJTe (ORCPT + 99 others); Tue, 25 Oct 2022 05:19:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232413AbiJYJS7 (ORCPT ); Tue, 25 Oct 2022 05:18:59 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C681216C223 for ; Tue, 25 Oct 2022 02:12:45 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id ud5so7305204ejc.4 for ; Tue, 25 Oct 2022 02:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eiyKXU5FxcBo4aQqXip+DivTGxVo/DuU5b7lG8hm9nY=; b=N+hlx+k2SXKWFiaDXDxEXL3461ZtjohMXc0sKc9tjykAPxjCG6LqEohmxBA1TsSLM6 upsrJeB37h9M+z3m80c1fQ/x6+x1ZnOpq9/RZCvb6iU8FAvytsqVm3sz7QKpibjnv5/B MG0ViYyYuQO2Leb6BKBFnq4V6SNT3dlVpdd6pLPwg/FLQ/8eppJkxIU7QxO4dK7d5dF4 pKaemWVBLB5hYMym1kB/U7VQhi7CekPVu77u9QwXUSWixAxDQtHPf6o0H9BPiuw2FfRD hkQIX8mU5EcJUh4Yjl+F8VnDtb5Mrj+SJcg0lTPqrVv416yhS1jh2ptDKfp1Q3Uw2V7d 449A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eiyKXU5FxcBo4aQqXip+DivTGxVo/DuU5b7lG8hm9nY=; b=McfHmKoXburTMroNQVQ2FS+NoREyk8QOh33/olv51ODRuLajQTVwe5810WERv15pVN N19a9Y4RMd6zrSXW4bIchdO7ZPeqFnS4Y9PgBmrjLLvgpnFy3oNw4lr91prDzK0cgnOn PFXYSJtLVgUMYNnoRmUV3l5xe1dvggyYHNvjx+ABJFGxqrZOj7FEVx8hL7r479vrIGma ZwpfhuCLlO9BjS/Hl/FiEkps/bI6JINTY2qrPjMCZ+2+VFwp41aq6i7Htaxr11ydDcmV gN/w6hSDxmSxE6c8xjA5mNHgvsOgrddVK8xVKW7Ydp29LbpQu7yQfsbvE6JawTDAvwhN n6Bw== X-Gm-Message-State: ACrzQf1vfiEEuWuCBHats3bpqRJUvDNrupgyKqX484TfyOYbtl54GCEG d+hGPs9tMaRK5R4O1a8csMg= X-Received: by 2002:a17:907:6eac:b0:78d:ce9c:3761 with SMTP id sh44-20020a1709076eac00b0078dce9c3761mr31116005ejc.738.1666689164330; Tue, 25 Oct 2022 02:12:44 -0700 (PDT) Received: from localhost.localdomain (ip-217-105-46-178.ip.prioritytelecom.net. [217.105.46.178]) by smtp.gmail.com with ESMTPSA id bo12-20020a170906d04c00b00780f24b797dsm1061953ejb.108.2022.10.25.02.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 02:12:44 -0700 (PDT) From: Nam Cao To: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman Cc: namcaov@gmail.com, Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/4] staging: rtl8712: check for return value of _r8712_init_xmit_priv() Date: Tue, 25 Oct 2022 11:12:25 +0200 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 The return value of _r8712_init_xmit_priv() is never checked and the driver always continue execution as if all is well. This will cause problems if, for example, buffers cannot be allocated and the driver continue and use those buffers. Check for return value of _r8712_init_xmit_priv() and return error (if any) during probing. Signed-off-by: Nam Cao --- drivers/staging/rtl8712/os_intfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 12adb470d216..205b7d66a40a 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -308,7 +308,9 @@ int r8712_init_drv_sw(struct _adapter *padapter) ret = r8712_init_mlme_priv(padapter); if (ret) return ret; - _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); + ret = _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); + if (ret) + return ret; ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter); if (ret) return ret; -- 2.25.1