From patchwork Fri Nov 25 12:03:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyufen X-Patchwork-Id: 25952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3952446wrr; Fri, 25 Nov 2022 03:49:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf77BWxM1nysNeteBC6b1A31/u4X0xaaRB9IgTW7wSwX/NC3LerfhberSkBbazspPQIxHOqe X-Received: by 2002:a17:906:6c7:b0:78d:4061:5e1b with SMTP id v7-20020a17090606c700b0078d40615e1bmr23094298ejb.47.1669376980847; Fri, 25 Nov 2022 03:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669376980; cv=none; d=google.com; s=arc-20160816; b=XwZ5JWc2ICePTrQ4khuvuFy3j2oPxgsAZx7EamMVcnGGoQveELP+B1GQxJdI6FXvBH MBbrjR/uXaVcDovnY2Bi8Sok5S6QthPTmJ/ncqAsTyn8rz2N+SRm0DNCZGWvnnfSlOfU oru1P7KcKpty06kRR+jUud/oD16O4ugViEBvxuIOx/iU+BwXAUZ/P51lFy/GgCLbK/Wa Op0TzOf5EcjRluPU9IHHq5rnUIUJYrY8S4tD6ozXlg+KzLDwg1+cvzC4IMy11w/vmP1d xeoeOxyp+fkkL7xeyUHaxUX8zzlBkfj3tpTIvOsr94MLSE0tvOj0YEUNe1Amm/HpBj3C HRtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=zZ2ZehKQcdxMxJsx8EzMJxJT6Cwgp1fwgx/QiSFKeMo=; b=eGvSmsljgyu0mmT4PGryBRKcyNE7l+ZMxZjXz2pLrNnk7ogcNVzvC8UWbUiUdK6esP Acu/x/zqMIHReUPCdYTG1GftMjEGMQR2A1exrLeR1vvQZain3gBjW+jgmAStWz061DbS elY/nvAdUXEBqMmQzt6EQ3AzyConZza3ss21CNdX4JpMj7noorT460rUZTxNd+FGwzNz H9p49H6E1jYzqPecyRNNQfLKshfoQ+19aJrdc2I/qy+KsvId8JZFx4hc7qORmq6BuInn O5b0eYiRXv0XfuoHHoIrOb1YxUkprypHLnQ+r05dt8aejesMvP1kOjdiFgnDfqpZQFBv CV5Q== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a05640226d000b0045fc914660csi4033967edd.200.2022.11.25.03.49.13; Fri, 25 Nov 2022 03:49:40 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229958AbiKYLnr (ORCPT + 99 others); Fri, 25 Nov 2022 06:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbiKYLnp (ORCPT ); Fri, 25 Nov 2022 06:43:45 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12ADBE1D; Fri, 25 Nov 2022 03:43:44 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NJXzx4p5Hz15Mv1; Fri, 25 Nov 2022 19:43:09 +0800 (CST) Received: from localhost.localdomain (10.175.112.70) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 19:43:42 +0800 From: Wang Yufen To: , , , CC: , , , , , Wang Yufen Subject: [PATCH 1/2] RDMA/hfi1: Fix error return code in parse_platform_config() Date: Fri, 25 Nov 2022 20:03:50 +0800 Message-ID: <1669377831-41386-1-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750468637052800184?= X-GMAIL-MSGID: =?utf-8?q?1750468637052800184?= In the previous while loop, "ret" may be assigned zero. Therefore, "ret" needs to be assigned -EINVAL at the beginning of each loop. Fixes: 97167e813415 ("staging/rdma/hfi1: Tune for unknown channel if configuration file is absent") Signed-off-by: Wang Yufen --- drivers/infiniband/hw/hfi1/firmware.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/hfi1/firmware.c b/drivers/infiniband/hw/hfi1/firmware.c index 1d77514..c179dfe 100644 --- a/drivers/infiniband/hw/hfi1/firmware.c +++ b/drivers/infiniband/hw/hfi1/firmware.c @@ -1788,6 +1788,7 @@ int parse_platform_config(struct hfi1_devdata *dd) * being used. */ while (ptr < (u32 *)(dd->platform_config.data + file_length)) { + ret = -EINVAL; header1 = *ptr; header2 = *(ptr + 1); if (header1 != ~header2) { From patchwork Fri Nov 25 12:03:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangyufen X-Patchwork-Id: 25953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3954907wrr; Fri, 25 Nov 2022 03:54:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4vQS/aMtp3UPdf0IPvO9dBhTxrCXTtCX08n9GstzM1xSRS5tL706qATbR1Gl9LF3oXL3ra X-Received: by 2002:a17:902:9882:b0:188:7a1f:fb18 with SMTP id s2-20020a170902988200b001887a1ffb18mr19174121plp.0.1669377295457; Fri, 25 Nov 2022 03:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669377295; cv=none; d=google.com; s=arc-20160816; b=k1WGsTdVJ4oKFtL29GZfv6vCGk9ng11yfesvogfW/VVJSX03rjgMhy2XW3t885718F DAjY5vQ5OAtGsL6ljkfTFLMJJJ/kdpif9dq0Z434GO0KCXAyYcvm1Z9hQDpRrbJtULQu CaWNvJlQGpeTnL+rC6znq6FkD251fBiZdz7adXog8q+ByRFQ51MfwWxXBmmOskjUcZcC sHdIEyScjh9Vz2yjfdhktP3Y/7s79/yr8VyKj7892RXAM+6Y5LpLJFGMpV81S7tGRXLb UB9m0TNJoFcoOF7F3uCSdkViz+Th7bJZkdhtnomkX9BGvr7DjLUy2v8yjm87dVH5CRTL Q9hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=CTsBAudpzw9qglm4FnxKpA1fz07hvhlcNrgY0BRmfF8=; b=ylUmU/vehVNq0Vtq9l3oiW0NWTY2pvWSGO61KHWXHw0PKcZSpGoo/UBa0NBfdBDtrJ v4AjZNd6Qrqji1kISr9px1OGMaszgv7vn78NJnSV593b1fiv7AwXBHHoNejcrVw2bAC4 BXoEnhlQmTlEJrOsR/JKEO1isbfJwB0tNPlUQJXHEgAHJAD2x7Kimijxm7Aymnlnrw/l YSZZuX7pI46XBFtquP9t+gnnv6bDtzOlY3cotVqR3SxRDxBUGs2oQGRRRRV8fCmiG2iu tzx0w1wfu8qWhsqBWqjY7Tts2L+c0LiPjaYcWtYq8r77rpiEbLPh9REeQ9RlOIj0lPQE 32Kg== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v189-20020a6389c6000000b004770fe91070si3865187pgd.587.2022.11.25.03.54.41; Fri, 25 Nov 2022 03:54:55 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229878AbiKYLns (ORCPT + 99 others); Fri, 25 Nov 2022 06:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbiKYLnq (ORCPT ); Fri, 25 Nov 2022 06:43:46 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC14ABF6D; Fri, 25 Nov 2022 03:43:45 -0800 (PST) Received: from canpemm500010.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NJXzs1kdfzHw7H; Fri, 25 Nov 2022 19:43:05 +0800 (CST) Received: from localhost.localdomain (10.175.112.70) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 25 Nov 2022 19:43:43 +0800 From: Wang Yufen To: , , , CC: , , , , , Wang Yufen Subject: [PATCH 2/2] RDMA/srp: Fix error return code in srp_parse_options() Date: Fri, 25 Nov 2022 20:03:51 +0800 Message-ID: <1669377831-41386-2-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1669377831-41386-1-git-send-email-wangyufen@huawei.com> References: <1669377831-41386-1-git-send-email-wangyufen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500010.china.huawei.com (7.192.105.118) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750468966962668075?= X-GMAIL-MSGID: =?utf-8?q?1750468966962668075?= In the previous while loop, "ret" may be assigned zero. Therefore, "ret" needs to be assigned -EINVAL at the beginning of each loop. Fixes: e711f968c49c ("IB/srp: replace custom implementation of hex2bin()") Fixes: 2a174df0c602 ("IB/srp: Use kstrtoull() instead of simple_strtoull()") Fixes: 19f313438c77 ("IB/srp: Add RDMA/CM support") Signed-off-by: Wang Yufen --- drivers/infiniband/ulp/srp/ib_srp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 1075c2a..1bd3559 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3352,6 +3352,7 @@ static int srp_parse_options(struct net *net, const char *buf, sep_opt = options; while ((p = strsep(&sep_opt, ",\n")) != NULL) { + ret = -EINVAL; if (!*p) continue;