Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2815530pxb; Mon, 18 Apr 2022 08:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys3IlumE0zFb9my/sSbyh4SbecuLwoVTwIOIjd5Fb6O9qWEYYZ6qHFOgV1fcKJmTYMsbr1 X-Received: by 2002:a17:907:7e95:b0:6e8:968c:8ecd with SMTP id qb21-20020a1709077e9500b006e8968c8ecdmr10093281ejc.187.1650296920832; Mon, 18 Apr 2022 08:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650296920; cv=none; d=google.com; s=arc-20160816; b=uW4/iXlFnqbaayDg4qN/v0dVfIYP0siAouMyuvnddpVqnSI2BDRoYS1ODye6aEJQjN 1//AMuE1nhJnB/3R/dAvPD1JvZO2M7P/TvZSv8aC7s6kgQzoUGXIXtDTHgNtPqvA5mVp QqgnveGh95x1gXKUZtdZyEmN05vHdY3uj2CNIa9s8YcH6AHQCembUTMKuukdxf4cMSPM qUDpTCqjkWMsPkJHCHTz+dVFKctKHdXhrSfn+Bu9yqI+4UCTnXSiKuDoOXL1i7ZS/uvO Q0viUSgQOJ36qbUmKAd8nFQsdFsVOk0eNOHI0MYu65CDqsO7b/QviVm7K06INnyONW6u zqqQ== 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=ehtdlJkrOuwXxLcfP3jp6fV7ptfYta5LMsCqk2stqk8=; b=SyhNwTDjqZiU9d4PcKWc2I9FkWK4viBQlkBEzBCsN9lmQ5/FxjTl22H74cOAHB1p1u xV6JyyHS6t0mEL5F4ajzHNlxo50CLUKjWaejULBdyWbGFWscPBsu2LcpTdo1Igc+aCX5 zgipQ6lmB9SabSJfKhXeiP+IeLvsBFw6l3LnCx6HKhwEmpe0FYxK556RvghBX8suqAkT 5iUTDaBu4gDisWFzYAif3wtgZBQ+hUwPtHvKzMglmCs5grs2jcLmWui54OkqPffhmpec 9LQceRMcmdaVkhAj2dmW3ILw8NsvN7MROT6VDrV00xCTWfMYrlHuUDFB0Cd6Nma+GQaX yu5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SrwmrRWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt22-20020a170906fa9600b006df76385cf8si6198592ejb.408.2022.04.18.08.48.16; Mon, 18 Apr 2022 08:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SrwmrRWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242440AbiDRNgR (ORCPT + 99 others); Mon, 18 Apr 2022 09:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243516AbiDRNKM (ORCPT ); Mon, 18 Apr 2022 09:10:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2CA838793; Mon, 18 Apr 2022 05:49:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1661061254; Mon, 18 Apr 2022 12:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9A6C385A1; Mon, 18 Apr 2022 12:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286166; bh=3ONAA+db7xXX+XCtiELFowQDfk4co1geMc+6o3v+NJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SrwmrRWsrkzFoVNM3J7ecedrPdR3W+yc7rK6YX8RQgMDlkuo2AbiHr0YuXzzVsJ4r 3Kxm1XPyzByUlha+DWmoI0vuHxJgFDayGJgy3Okd2JlXGqR3u0ZYBs5Y/Jpo2CywY8 3XnmtJOsnDIqE9YF1AYdGprCEBWjcu7RbZ+DYdSQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arend van Spriel , Hector Martin , Andy Shevchenko , Kalle Valo Subject: [PATCH 4.14 050/284] brcmfmac: firmware: Allocate space for default boardrev in nvram Date: Mon, 18 Apr 2022 14:10:31 +0200 Message-Id: <20220418121212.119599509@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hector Martin commit d19d8e3ba256f81ea4a27209dbbd1f0a00ef1903 upstream. If boardrev is missing from the NVRAM we add a default one, but this might need more space in the output buffer than was allocated. Ensure we have enough padding for this in the buffer. Fixes: 46f2b38a91b0 ("brcmfmac: insert default boardrev in nvram data if missing") Reviewed-by: Arend van Spriel Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Reviewed-by: Andy Shevchenko Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220131160713.245637-3-marcan@marcan.st Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -216,6 +216,8 @@ static int brcmf_init_nvram_parser(struc size = BRCMF_FW_MAX_NVRAM_SIZE; else size = data_len; + /* Add space for properties we may add */ + size += strlen(BRCMF_FW_DEFAULT_BOARDREV) + 1; /* Alloc for extra 0 byte + roundup by 4 + length field */ size += 1 + 3 + sizeof(u32); nvp->nvram = kzalloc(size, GFP_KERNEL);