From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5440C43331 for ; Wed, 1 Apr 2020 21:45:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B60AD2054F for ; Wed, 1 Apr 2020 21:45:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="Cgf9oKN7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732637AbgDAVpA (ORCPT ); Wed, 1 Apr 2020 17:45:00 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:62047 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732357AbgDAVo7 (ORCPT ); Wed, 1 Apr 2020 17:44:59 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1585777499; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=e3zly8EY0dRy37KVBsBX4TrhRb0VszK/IxwznVQLwAc=; b=Cgf9oKN71gUdKJYbYiGGW775ogX73CJigYhe9zeZ4Fe1nlMBXJ2EKuXbUd0nkkWYNOCtP/Ey IfbdL8Q6kE/+cLJvxOU8CM6r0rQd5KRkr9VRj0IvV+6Qiy7OCAS7dAc75ToGN2Hl0PJixH+X uT/56VSIRjuuAbiVdiy6n/9kD38= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyJiZjI2MiIsICJuZXRkZXZAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e850b54.7f768e61c260-smtp-out-n01; Wed, 01 Apr 2020 21:44:52 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 73191C433BA; Wed, 1 Apr 2020 21:44:52 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: subashab) by smtp.codeaurora.org (Postfix) with ESMTPSA id A4E90C433F2; Wed, 1 Apr 2020 21:44:50 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 01 Apr 2020 15:44:50 -0600 From: subashab@codeaurora.org To: Alex Elder Cc: ap420073@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, Sean Tranchetti Subject: Re: [PATCH net] net: qualcomm: rmnet: Allow configuration updates to existing devices In-Reply-To: References: <20200331224348.12539-1-subashab@codeaurora.org> Message-ID: X-Sender: subashab@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2020-03-31 18:06, Alex Elder wrote: > On 3/31/20 5:43 PM, Subash Abhinov Kasiviswanathan wrote: >> This allows the changelink operation to succeed if the mux_id was >> specified as an argument. Note that the mux_id must match the >> existing mux_id of the rmnet device or should be an unused mux_id. >> >> Fixes: 1dc49e9d164c ("net: rmnet: do not allow to change mux id if mux >> id is duplicated") >> Reported-by: Alex Elder >> Signed-off-by: Sean Tranchetti >> Signed-off-by: Subash Abhinov Kasiviswanathan >> > > This was a regression in 5.6, and got back-ported to 5.5.11 and > possibly further back. Please be sure the fix gets applied to > stable branches if appropriate. > > If you happen to post a second version of this I have a suggestion, > below. But the patch looks OK to me as-is. > > Thanks. > > Tested-by: Alex Elder > >> --- >> .../ethernet/qualcomm/rmnet/rmnet_config.c | 21 >> ++++++++++++------- >> 1 file changed, 13 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c >> b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c >> index fbf4cbcf1a65..06332984399d 100644 >> --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c >> +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c >> @@ -294,19 +294,24 @@ static int rmnet_changelink(struct net_device >> *dev, struct nlattr *tb[], >> >> if (data[IFLA_RMNET_MUX_ID]) { >> mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]); >> - if (rmnet_get_endpoint(port, mux_id)) { >> - NL_SET_ERR_MSG_MOD(extack, "MUX ID already exists"); >> - return -EINVAL; >> - } > > My suggestion is this: Since the endpoint pointer isn't used > outside the "if (mux_id != priv->mux_id)" block, you could > do the lookup inside that block. I've sent a v2 now based on your comment.