Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3829768pxb; Mon, 1 Mar 2021 22:44:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwR0HqKNPjsBgWAcb0r7XkQWsqPEmzCbtb03rp6WeaWsgMDZ/03Ko3C/EjW8TspXkjAUyHF X-Received: by 2002:a05:6402:c0f:: with SMTP id co15mr1304349edb.373.1614667478656; Mon, 01 Mar 2021 22:44:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614667478; cv=none; d=google.com; s=arc-20160816; b=zCMlSoQmlzQzGJShVVdbg+14B7pArV6GntKnb9gMfbY5nP8PDnLws/DggP+oY5ub/q 5CPNWWymM05+IAny4X7f+LcExP+AztcZvqaWMcNSkyJeuqgzzGxWHIhoRVQ4epl2JS6Q h4oOAOe8tzrFKaoQj18ByUEouCR+JBIso6f0pnJcue15cYFpGFMRPupvG9HPM7lRI+KJ Z3IO367hMAWxHFSh3LVWo7NZ22x6MyyprAoCkpzIJdgUFC/WtuCppZlyxxB0Lkk90tcD EMsYAQrUR7k8vX/FMDLHiULC09MNm9JZtUWonI4O20Vkqw466vdC3qq4t09jE/fxvYoM 4xfA== 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=aramSJu1vkzpi6Cl6R2VYqulmfOljFKEow3uf0vJCgA=; b=VVHVF+CvHCUl8Hu9byO2aoAoPGYfkYziNdeoXh1Mgt8GYynwlldqEx+ZiySE7+SDDI czGYZTJivgbvn6ByvXjdXh1nCiVwylKclQfTmrbrqJYe5GkILLNkAbXF1byFEuuzirnK 43+kWmWPVIZD+tgIIACM3XTE/t73VAmA3XrFOQFs2BgrV99mUxINdgPixyTLvICFatlt IPmDEIMw/hgcU1jCEFTFMyeIJhARalhElOeyNAFvD2MWgy0YlV6+JyTbXCrZIfnTVUyM VkIUPQaxFHwVVowQGf/D+7fVMRoP4OjNoy6hosRk2vgIF+gOVzzv2DrbHOyrjXK/iTtF Hw5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="w/yGeLcF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot6si1830662ejb.337.2021.03.01.22.44.16; Mon, 01 Mar 2021 22:44:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="w/yGeLcF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1377239AbhCBAqU (ORCPT + 99 others); Mon, 1 Mar 2021 19:46:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:51594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbhCASjw (ORCPT ); Mon, 1 Mar 2021 13:39:52 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E0BA64E31; Mon, 1 Mar 2021 17:13:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618829; bh=AMAovv1m707oJ1y9ptFW2suwX9WU19RRVpElkic2UbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w/yGeLcFLcsoWAHZSCV8H3kcK5WkjF3wTfd16/h3R1PKYLLUCf/zlGuywx+ncaxIG sDUw0D59FLRyUyv/qzZ6FCPFmXS0irGxhj0t6GiOjBgFW38E4vqW0f62fb5T46ivva F70ssxypKOZ9ZZCqqiLoOr1XTabfwwp3lxQeLrDM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 202/663] mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions() Date: Mon, 1 Mar 2021 17:07:30 +0100 Message-Id: <20210301161151.774797983@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 12ba8f8ce29fdd277f3100052eddc1afd2f5ea3f ] If the kstrtouint() calls fail, then this should return a negative error code but it currently returns success. Fixes: dd84cb022b31 ("mtd: bcm63xxpart: move imagetag parsing to its own parser") Signed-off-by: Dan Carpenter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/YBKFtNaFHGYBj+u4@mwanda Signed-off-by: Sasha Levin --- drivers/mtd/parsers/parser_imagetag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/parsers/parser_imagetag.c b/drivers/mtd/parsers/parser_imagetag.c index d69607b482272..fab0949aabba1 100644 --- a/drivers/mtd/parsers/parser_imagetag.c +++ b/drivers/mtd/parsers/parser_imagetag.c @@ -83,6 +83,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, pr_err("invalid rootfs address: %*ph\n", (int)sizeof(buf->flash_image_start), buf->flash_image_start); + ret = -EINVAL; goto out; } @@ -92,6 +93,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, pr_err("invalid kernel address: %*ph\n", (int)sizeof(buf->kernel_address), buf->kernel_address); + ret = -EINVAL; goto out; } @@ -100,6 +102,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, pr_err("invalid kernel length: %*ph\n", (int)sizeof(buf->kernel_length), buf->kernel_length); + ret = -EINVAL; goto out; } @@ -108,6 +111,7 @@ static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master, pr_err("invalid total length: %*ph\n", (int)sizeof(buf->total_length), buf->total_length); + ret = -EINVAL; goto out; } -- 2.27.0