From patchwork Thu Feb 4 01:06:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 376139 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp808625jah; Wed, 3 Feb 2021 17:09:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLOfPxsMlY7HYJ0Jau/hwYbpR8IfnYUBzr+fZzjyvzVXc+hKLlepHEcQpVrBiHB69VYHLt X-Received: by 2002:a50:998f:: with SMTP id m15mr5854172edb.342.1612400940011; Wed, 03 Feb 2021 17:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612400940; cv=none; d=google.com; s=arc-20160816; b=K2uQnVPp7mWn3qVBfzfT9M9YUr5Go7ipT6wQgWtppS1ZDZM/qhLHhMFA6AQ/Hn4ThK Ax95MuO/YSR2wD7grB/YZFZapHmOFHt3TBVYgr/ldCa30VWMdhpblLofsSw+HugKn06g Gxi/vB5SQtiLpHodfKSqNVNycwcgrP6GVb/zZp+ZeE3TuJytHZfQJPa8xmGFtX2PhM6I VxQGVRYXS8V4EWjPJZDULkm0cbFnPTq9BSxUCU2s3e3YNQExvsrQSPqBxLhF2KFZ8xjR kPca9aKWVdL5U7xXIB5XQNZittiDLh0ppZ1kAYzibesPi4c7ur8fCD8seoE9t7eS7uSV nZDg== 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:dkim-signature; bh=CgG8Hwt3SxrrGY2glvsXSBuEtqHY0gWizrBC8qUvw4s=; b=qsj7bL5cXN+EyMmdPWYXooxT4q8TEnCPGZLdLE8yNSzLYLH+KkSSAh9DcNOVFDl4AV y8Et8cThNORLi6k0QKMf+SdSddbYVzR0VmgbcyeiGmomc8GtA9Ec56kqIHiwXm0CXtYJ UsQnAY37Ds9o08NAu8peoZamd2gNwI99NKvZKYH/A9i0q51qOTmy+eWpVFh/NggWSfKk 2DRyvaMTQeBtFlIu2Mf2sj95XRWtTtlzqgiSHWpQ2OkGnYzlsl2kNdD/SF3zT8m7AXiO /74/nx7zmw4QOnvcfWoZ6OeXLBpJywWPyUX2XV37x9S/JA0wmH3H9C6ppxoMZfX0Fu2v rxVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D1pTorP4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si2294591ejn.270.2021.02.03.17.08.59; Wed, 03 Feb 2021 17:08:59 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D1pTorP4; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbhBDBHn (ORCPT + 7 others); Wed, 3 Feb 2021 20:07:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233851AbhBDBHk (ORCPT ); Wed, 3 Feb 2021 20:07:40 -0500 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A0C4C061573 for ; Wed, 3 Feb 2021 17:07:00 -0800 (PST) Received: by mail-io1-xd2b.google.com with SMTP id u8so1417664ior.13 for ; Wed, 03 Feb 2021 17:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CgG8Hwt3SxrrGY2glvsXSBuEtqHY0gWizrBC8qUvw4s=; b=D1pTorP4NprD0zWgkamOJfsGSCSkxnvm31BrzhpMlqbViV+4DDU9FL8W9UQt3bdOR7 KiQvr+MFwzkcYS9kqf9RoB8QlEHq6PdgxYv7r+HYot9Tz2LWutxOO6ub4pIE9pWitBg9 sVp8QqKP+4QKs0RuVoNGtkZVwai+UQu7UW55YdNtwxupxRYTgAzLZJsKcCsVq4QhPTYR yRXgE1xutsru6N2nUJxUy3T1l7YiP/rXjUNsRxYlib8Tvy/S52qm/KGzacllErHf+4zt TEdzSTn0f6cRKEHEmEztcLnpy6vPHrr8EeXrAx176Y0pd/A1tiokhPgXv87Zya1l+/ha hdgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CgG8Hwt3SxrrGY2glvsXSBuEtqHY0gWizrBC8qUvw4s=; b=TCqB5GRXaDVdQW3kwrWKYBVKJOTINRd3MLZvdNKQtL9wjhJpBal31iL+Y/GDE0H5vm 3PooHUFyc73yVyZotBX32eiuQtvj3hHhYn06qwjFNGLPfGO2VskXkTLKHmFl5cchHfSp HZ5ut9bJDdnk0egiD5m5gN5iJ3PGA8RRvlGeD3RvYam7Avr1vhdFJAw0oqrlI1eWtR94 PjpBFvBhTPc9rP4jBKh0KSqFQXLI7RgmPhSwOErgBaSAcFQdpHVwMzC2BJciE3qPToMM NCCnJn5UI5WvKXnwouEoUQn+00dYD1OsGKO1P8OeNPDuLSBNc4GyKVPJ/F0Ce7PaIxia aP/Q== X-Gm-Message-State: AOAM533KIVWKsi6r8RD/jnElL9rW9OyulL+2OFVeum/34ShoWQd/9yvG L/6BFulbwqZ2G9mJXDl5JBqRuQ== X-Received: by 2002:a05:6602:1223:: with SMTP id z3mr4786869iot.130.1612400820029; Wed, 03 Feb 2021 17:07:00 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id y16sm1813495ilm.7.2021.02.03.17.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:06:59 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: dan.carpenter@oracle.com, elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v2] net: ipa: set error code in gsi_channel_setup() Date: Wed, 3 Feb 2021 19:06:55 -0600 Message-Id: <20210204010655.15619-1-elder@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In gsi_channel_setup(), we check to see if the configuration data contains any information about channels that are not supported by the hardware. If one is found, we abort the setup process, but the error code (ret) is not set in this case. Fix this bug. Fixes: 650d1603825d8 ("soc: qcom: ipa: the generic software interface") Reported-by: Dan Carpenter Signed-off-by: Alex Elder --- v2: Added "Fixes" tag. drivers/net/ipa/gsi.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 34e5f2155d620..b77f5fef7aeca 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1710,6 +1710,7 @@ static int gsi_channel_setup(struct gsi *gsi) if (!channel->gsi) continue; /* Ignore uninitialized channels */ + ret = -EINVAL; dev_err(gsi->dev, "channel %u not supported by hardware\n", channel_id - 1); channel_id = gsi->channel_count;