Received: by 10.223.185.116 with SMTP id b49csp719387wrg; Fri, 16 Feb 2018 06:10:44 -0800 (PST) X-Google-Smtp-Source: AH8x224Wz4pnBkpttTcVzIaopaOhL8PjZdN5ObY71g9JD9iM5hUwyH11PBCc915OUEt7fQFeD3QD X-Received: by 2002:a17:902:a03:: with SMTP id 3-v6mr6011560plo.282.1518790243924; Fri, 16 Feb 2018 06:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518790243; cv=none; d=google.com; s=arc-20160816; b=jbRqTzL+huQthFF92ppbCBX9kaGdHPG2CPVr8B8LPmjrw1T4b6gLOQZDmzcykVzQSX IcKz9FrKEp/tZACEOtGpQpXpI681FpVBpS0n6fJwiGioyNEpBYBbCKi03mlHBcepneYf mL+mzM/Z86uAXBP2DiWs4XGQCvEiGCsMOukxsqLDYWvTU65jRjhRBbkfFL54RlxWZVoN 4A9hdZXkSXpFkXDvrtR4ldRAksF/qjFu4qYKHPcy9Ku7jKRRYw9EsmIsIjNf7M2Bo7r+ ofbFdivC/uDokvk0ktDkCqZkmYTTWmfgQFzfg8F2oVsltnTq1LEyE2awdhGeR9Ygb8sZ Mv+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=O8NRPoK2FfQOkMVH66Z6O1qJRc/69y+st/dRBIjjYPo=; b=PCRMbjE7/hkrfNIP0EvZ6kcJP3l+iNdUms6N7cboO5yJR7eApDIUWW+JY87+tsd9c8 /LhtWfkXIlN8dp0r+sxYXPtCvFH00gKLX/am3YSe1f3R+NaIlzlEXo00gjghhtHUk9aE xWwtKJUYM3Bjzp9ZuEUHxe0NLMrrA6DnyYZQ3xKi0RS2SB6kmFCMOueyfvR7EFa9DKwk QBlvGLdw2l/HWPjZH6aB7vIiPdj0SvEVbz05RKr7CEZll+plvEmtMjmflsqi1PUf6k6E vi+gwKe3XYOL/m9Op9N2MtZqNNzhmhbHML3KalMy+2X1UowHL/HCjD+smvSCV+TCp95X jHLA== ARC-Authentication-Results: i=1; mx.google.com; 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 t134si1272592pgc.664.2018.02.16.06.10.24; Fri, 16 Feb 2018 06:10:43 -0800 (PST) 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; 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 S1166954AbeBOSwp (ORCPT + 99 others); Thu, 15 Feb 2018 13:52:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161956AbeBOPVP (ORCPT ); Thu, 15 Feb 2018 10:21:15 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BD96D1110; Thu, 15 Feb 2018 15:21:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , mrkiko.rs@gmail.com, Matthias Hintzmann Subject: [PATCH 4.4 020/108] net: cdc_ncm: initialize drvflags before usage Date: Thu, 15 Feb 2018 16:16:17 +0100 Message-Id: <20180215151225.377489173@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Hintzmann ctx->drvflags is checked in the if clause before beeing initialized. Move initialization before first usage. Note, that the if clause was backported with commit 75f82a703b30 ("cdc_ncm: Set NTB format again after altsetting switch for Huawei devices") from mainline (upstream commit 2b02c20ce0c2 ("cdc_ncm: Set NTB format again after altsetting switch for Huawei devices"). In mainline, the initialization is at the right place before the if clause. [mrkiko.rs@gmail.com: commit message tweaks] Fixes: 75f82a703b30 ("cdc_ncm: Set NTB format again after altsetting switch for Huawei devices") Signed-off-by: Matthias Hintzmann Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/cdc_ncm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -825,6 +825,9 @@ int cdc_ncm_bind_common(struct usbnet *d goto error2; } + /* Device-specific flags */ + ctx->drvflags = drvflags; + /* * Some Huawei devices have been observed to come out of reset in NDP32 mode. * Let's check if this is the case, and set the device to NDP16 mode again if @@ -873,9 +876,6 @@ int cdc_ncm_bind_common(struct usbnet *d /* finish setting up the device specific data */ cdc_ncm_setup(dev); - /* Device-specific flags */ - ctx->drvflags = drvflags; - /* Allocate the delayed NDP if needed. */ if (ctx->drvflags & CDC_NCM_FLAG_NDP_TO_END) { ctx->delayed_ndp16 = kzalloc(ctx->max_ndp_size, GFP_KERNEL);