Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp469023yba; Wed, 15 May 2019 04:40:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYDkL6uMkV4DFz1sFjNiP/Qtxmh8WW4tQOfGgCYkdEWgSu05e9Q3zC8N94IWK3kxdJ9Be6 X-Received: by 2002:a17:902:e407:: with SMTP id ci7mr42962492plb.219.1557920415537; Wed, 15 May 2019 04:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920415; cv=none; d=google.com; s=arc-20160816; b=orjH0bvEAutqzGmJV5Rkxe13B72D8Gn1kCzhEXmJ/BKJXrEpGB1wkZlkF0e5Hx7JSQ qHpHE4Yyj5szbVC5G3GaN08GbpAtfKoZmlR74Zm9CrGofvh6hYAJPLKX1NXcyKV400Tj qnbhzJAvmAC4R7joOzymkXA3n+H5dz8gCdHG4Du5GGk+GHiqgSWWOjj/ME+xfOVOH6iJ ZzKhB3spyE7jXEVrQhLEFAs7iVIKOhmrDSLFBuYWl8wrUyST3uUoy6RAYWGlsw7LeGbc dlilLgk6gKw5oJETHPJGTSAQ+DQK2UNAORmo0S6VRBsfL7JmM1YKx6UrxfRXkeCjD5QR b4CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CnjH2kqP33eNefl7W4vmT31V7dIGkBbegaNDoQjOaJk=; b=YUXeFsVltIxrHktA4DILjDWj0CaQWegwz8sTuS8CAX+RKVBoQwZQ2vi1ldpfGFgfmM Oykvg60lvdXY+Ro3hy8zELBLJjKFB/cipgsfsbojNFhaXYAuCnNqictmfKNkC+VxpnU/ Rbk3Ewc2FwwSPLZQhIFazKuVhuMrMqHvBCOSr5yD+xat1EKiLhxd2rUYQgY/V9vmh1/S Eiq0iuzQ8YRt6YrSBOqEBfU4vH60Z/UzIhApi1s58EqPVnvumwZh3uyNh6+dqrS2e6aF jhHzVZkw/vrLVh0Uin5azqZcX0y/HwvUFoUsClOQjFY7lFOC8V4bkFyjvE/qBFF3iqcx 9LdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qvuve4d9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a89si1617952pla.348.2019.05.15.04.40.00; Wed, 15 May 2019 04:40:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qvuve4d9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731165AbfEOLb0 (ORCPT + 99 others); Wed, 15 May 2019 07:31:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:43132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732379AbfEOLbW (ORCPT ); Wed, 15 May 2019 07:31:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D701F2084F; Wed, 15 May 2019 11:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919881; bh=f+/E2dM8tseZgOi6tp1gOUPwluA21xqL5ItupbIbfPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qvuve4d970pqV9AeelC/vHeRiihj8Hxl7KIDQCgOuReK9XXIaXmJ4DgaF90a/RnR9 CKUobI38OzkTaGRJCasR5YoloAKdi5KW2SYAVPR+ZtfjlPI1aOuyLlvm/RcCSLhYni x19ksNck+KbbwRWjIU6wnQ09El2TjZVoXEHKpRM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , "David S. Miller" Subject: [PATCH 5.0 122/137] aqc111: fix double endianness swap on BE Date: Wed, 15 May 2019 12:56:43 +0200 Message-Id: <20190515090702.572049973@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Neukum [ Upstream commit 2cf672709beb005f6e90cb4edbed6f2218ba953e ] If you are using a function that does a swap in place, you cannot just reuse the buffer on the assumption that it has not been changed. Signed-off-by: Oliver Neukum Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/aqc111.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -1428,7 +1428,7 @@ static int aqc111_resume(struct usb_inte { struct usbnet *dev = usb_get_intfdata(intf); struct aqc111_data *aqc111_data = dev->driver_priv; - u16 reg16; + u16 reg16, oldreg16; u8 reg8; netif_carrier_off(dev->net); @@ -1444,9 +1444,11 @@ static int aqc111_resume(struct usb_inte /* Configure RX control register => start operation */ reg16 = aqc111_data->rxctl; reg16 &= ~SFR_RX_CTL_START; + /* needs to be saved in case endianness is swapped */ + oldreg16 = reg16; aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); - reg16 |= SFR_RX_CTL_START; + reg16 = oldreg16 | SFR_RX_CTL_START; aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); aqc111_set_phy_speed(dev, aqc111_data->autoneg,