Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5065791pxb; Mon, 15 Feb 2021 08:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3rIYPlMusf8yYP3UcmVHwcL0Q1d8+Lk4qlvbIAdCCkHwrtGlTP113ZOzDOoIFxkB14H+Z X-Received: by 2002:a17:906:d8ca:: with SMTP id re10mr16564386ejb.18.1613406989199; Mon, 15 Feb 2021 08:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613406989; cv=none; d=google.com; s=arc-20160816; b=Wm7H6WMmnVRFeSnoZnjqGw/FUQbZknZt8ds2JNMbbD5GlOMLkuyOM+TLx2ZeslM8Py IWGoNkJGyu/0IEmcGutZv5ZbdvNRHfVqNSqyMvtILu+hXr6EvpztBRrIY+14Bj87oPhu vdhC0QOMGV1mlYjWAZCp5XRyqo9/OQ/LwjYcRg1SaZNoNOjOQ7MD4zkzJsoLImnqbc7Y +4gfpm9+UEPilC7pQFb3zyUTzqOazgOfxLZl2Luk81AkqEfo6dReRXwZMBd1JXUiBRSA ZBtAEzWmFkqu/K1VUczqLIM7tg9hxH6HlCekxE9ndILCGBd0em0wvY/q5tXmtv0GPKuN Miuw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OUh1R1Dl4WI6280W36B3RXQ2oQN3tr/YubUrxSQ8uHs=; b=FnHSTWhJottcDCCZ7OO/hsbQCKuJe6g7l6gLnzLVe3xZxwYbqZF/N310UJyHuyXYmR xb7mxPbMQfAXK4c8bFRdX9zxkEKmesbOGw3luPgeJvRs2FGR5dnvDlyZc3tg6Utq8yfw TFifa8TljKjnk5dv0qhqEANJDclsAz2OhZhLKtT4/owQpw/f31w248x5e+qxsPAzqM8R swcwc7dzUS81KFHBp6myQeKz3cQFz4j6oNeITZZJ0c7VVuA5yaAusrFsAQgopt9ZfCtc gymFlyBW1fuxS9OlmRsAljbxcDxrGndkGyzJ37c+OFihBkt78Er5wozehY7HREAnooOV KWTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IOPUSQF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd22si9079652edb.69.2021.02.15.08.36.06; Mon, 15 Feb 2021 08:36:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=IOPUSQF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbhBOQf0 (ORCPT + 99 others); Mon, 15 Feb 2021 11:35:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:49638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231463AbhBOPht (ORCPT ); Mon, 15 Feb 2021 10:37:49 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 456A664EA3; Mon, 15 Feb 2021 15:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403191; bh=2d82ML/lsPXn5JpjMp119lFurxZ44IhVjiVuGINp/T8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOPUSQF8XRdhHPKp9w9xHiWjcAcJtt9WtrHpdxvjJ7dbv4z3eF0Bliq1WX0vPxkCv pCcOGDOguooHw9HBNAt+ALeBJ1RMjDKlcBF3OBUd2r0uWhBpbeY/KO1SHGWdcspq/R u19Q9mEwTYW+fxkg/C8dWmqU8rXZRfatkvVybFV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xie He , Martin Schiller , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 062/104] net: hdlc_x25: Return meaningful error code in x25_open Date: Mon, 15 Feb 2021 16:27:15 +0100 Message-Id: <20210215152721.473422296@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xie He [ Upstream commit 81b8be68ef8e8915d0cc6cedd2ac425c74a24813 ] It's not meaningful to pass on LAPB error codes to HDLC code or other parts of the system, because they will not understand the error codes. Instead, use system-wide recognizable error codes. Fixes: f362e5fe0f1f ("wan/hdlc_x25: make lapb params configurable") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Xie He Acked-by: Martin Schiller Link: https://lore.kernel.org/r/20210203071541.86138-1-xie.he.0141@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/wan/hdlc_x25.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c index f52b9fed05931..34bc53facd11c 100644 --- a/drivers/net/wan/hdlc_x25.c +++ b/drivers/net/wan/hdlc_x25.c @@ -171,11 +171,11 @@ static int x25_open(struct net_device *dev) result = lapb_register(dev, &cb); if (result != LAPB_OK) - return result; + return -ENOMEM; result = lapb_getparms(dev, ¶ms); if (result != LAPB_OK) - return result; + return -EINVAL; if (state(hdlc)->settings.dce) params.mode = params.mode | LAPB_DCE; @@ -190,7 +190,7 @@ static int x25_open(struct net_device *dev) result = lapb_setparms(dev, ¶ms); if (result != LAPB_OK) - return result; + return -EINVAL; return 0; } -- 2.27.0