Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp332010ybi; Fri, 7 Jun 2019 08:46:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+sa9TJCykIfdb2jXtWVVzyXEO7UA/ocmE6HESefYq0CawKm3czCXzXBt366raZ171MKGs X-Received: by 2002:a17:902:9a49:: with SMTP id x9mr35950518plv.282.1559922369197; Fri, 07 Jun 2019 08:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559922369; cv=none; d=google.com; s=arc-20160816; b=w0urdAic9/ai7PtRl4ePTGYIqQr+c2rdB7H/vDQbgApAnN0f/Pp0Y5X17Z5E8Af/np gm1MCzyX+GVWsBTFj6HBbW13p0Q/Z9gqYyR/DyDJN1146ArDB2fGj134aLwZEPmn8EnJ K+k94MKgbGAyBbtZXExCVKmU4cs6kixGSIlijbt2nGFZrp4Go7+XOsdSJcs4HkrYALDL I5Fdju2JX9RgEGHCx8p3VIMCvKe6tzaMF2oKie8BaILYIM85SpvyR7EY1IMssmgdZDn/ Nxn9byty5CMty1qSqD1wBuMAKfZN2vFat0cgcm9Q2nNWzRWVH060cBq9l6NBaH/8P0VZ VonQ== 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=y87WUBPlexvZ7BezKN5CCjgz5DCB3QSObGgtnJWLhUk=; b=R4Ime77BqgI/zdZNjLVT6fZkp3hy4G7xrdONTihJpXf56TtpPErHk46I5MaOx+PD32 jMD0qzwsSYzyc4Q6Ur8k+rAdnLEXecwUUR8jAIZ3goQq1cU+IaTMtYa4DrFsRZmhcZ6D UDd//VTnIFPNO4X9tMusN8sIcZqzIFjva48JyWEzq3oXdzUARDAnUHSlp5bNZ15AleLF fjvxPqNmuM6yxa15MerkyMchFj6qDlDpxRR4fEelJh6JKJdTHmR0yQsqB5UwUVBDRilk U39MMpAlRlSYzTcWfl6IIr3ksPi68cB/+tG7AQDLFRTjZFbmTeVqyrs3lD3mgtS9jNwU 0O4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uW0WWMjA; 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 gn16si741445plb.179.2019.06.07.08.45.52; Fri, 07 Jun 2019 08:46:09 -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=uW0WWMjA; 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 S1730632AbfFGPmm (ORCPT + 99 others); Fri, 7 Jun 2019 11:42:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729772AbfFGPmj (ORCPT ); Fri, 7 Jun 2019 11:42:39 -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 2D760214AF; Fri, 7 Jun 2019 15:42:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559922158; bh=CEg1spDROT8I4kU1zXMKX9TQSs6MvE3Zy6f+1mgUizM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uW0WWMjAxBZriSeD0OZSQX2A+ZOTFxuvKoDBdP9Ge9tYbTNsFOMpTHL5dZayBdpW5 b86eR37KbIYTHRROwx092C9I3Ob7NuZTsqOqO3nDjuTJ6/7Fe2DbQHsLVZlEedH9PX zoZQ/F7kgU+EiaMEcTV1z5kwRujmi14T4dJBJw+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Collier Subject: [PATCH 4.14 58/69] staging: wlan-ng: fix adapter initialization failure Date: Fri, 7 Jun 2019 17:39:39 +0200 Message-Id: <20190607153855.248900344@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190607153848.271562617@linuxfoundation.org> References: <20190607153848.271562617@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: Tim Collier commit a67fedd788182764dc8ed59037c604b7e60349f1 upstream. Commit e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.") moved the retrieval of the transfer buffer from the URB from the top of function hfa384x_usbin_callback to a point after reposting of the URB via a call to submit_rx_urb. The reposting of the URB allocates a new transfer buffer so the new buffer is retrieved instead of the buffer containing the response passed into the callback. This results in failure to initialize the adapter with an error reported in the system log (something like "CTLX[1] error: state(Request failed)"). This change moves the retrieval to just before the point where the URB is reposted so that the correct transfer buffer is retrieved and initialization of the device succeeds. Signed-off-by: Tim Collier Fixes: e895f00a8496 ("Staging: wlan-ng: hfa384x_usb.c Fixed too long code line warnings.") Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/hfa384x_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -3119,7 +3119,9 @@ static void hfa384x_usbin_callback(struc break; } + /* Save values from the RX URB before reposting overwrites it. */ urb_status = urb->status; + usbin = (union hfa384x_usbin *)urb->transfer_buffer; if (action != ABORT) { /* Repost the RX URB */ @@ -3136,7 +3138,6 @@ static void hfa384x_usbin_callback(struc /* Note: the check of the sw_support field, the type field doesn't * have bit 12 set like the docs suggest. */ - usbin = (union hfa384x_usbin *)urb->transfer_buffer; type = le16_to_cpu(usbin->type); if (HFA384x_USB_ISRXFRM(type)) { if (action == HANDLE) {