Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3946208pxb; Tue, 2 Mar 2021 02:41:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ+H96b7IElrf6TU1MJhWgI2RBc32GC7rwtBrE1xNqFZQE4FMlAVWRzePkJeeuv93nfypg X-Received: by 2002:a17:906:4e57:: with SMTP id g23mr19895832ejw.47.1614681659983; Tue, 02 Mar 2021 02:40:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614681659; cv=none; d=google.com; s=arc-20160816; b=QrOp8xDF9lfJLWK2pwkZoOTdO1IYVpAceYnOkVU8dbGg6BdJcf5ncgpzbQn5U15PfL CajafPxvYHmlrRnDbcJy0ZOJWobHYtbTp96NVA6wOL2TAr1q3VX/dh7ph/3kfhbdtc/i p+TKmdJm68DOxM+V/946rv4NBEFJFyvqlzPIVzQ9hVsfPviVurRugZI26oQa1kDD58d9 eCHyR9x2eeUaKfe1T1bLgp4eN+qWK0oklVVl83syGX9fIHfYbtN5jzCl6wNkJfXiI5i6 PQ6ZQfW8u1qnqZagI28iSXjo62+uBKKtbnnQNKn4Gu/M8C/1qjxmTRbKIuXamMoxNnc6 OYZA== 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=9ot/R7JVdD7ZWc6g+b6qDYA5E8WnB9z/ipMjaoBFXoA=; b=dT8YVtsE8JYjRxN8ouSYQIssff43P+qopiz58fD5tI3ID8IYDbN5K3kz+/x9YJOWuf 98ODt5qrZKorbmloDTwIFUW7AfA35jkiWy6JyT+z5B8Oz7iv/WCEprIH0mI2RPi4WJnp 0as7EsWh6WWkhUH3VdPZj7qAoryfp0f9DpJHgixenGJ7fEPREX5GoskF7dqDBLJLiwaJ vUimtfyfCm6SRAPkFir6KTDHggAziVSrcxzCuikL95TpW33I4LdhAWHJ9rTg5oRwZFpj RzI9G5WFS66eunJ9N/peAExDNu96ROBbMqzqNQuV7ftralHnydO10FdjCGjdFkwfRRf6 OAvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FN1BdQCN; 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 y11si10474908edd.49.2021.03.02.02.40.36; Tue, 02 Mar 2021 02:40:59 -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=FN1BdQCN; 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 S1345787AbhCBBq2 (ORCPT + 99 others); Mon, 1 Mar 2021 20:46:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:46132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240706AbhCATVo (ORCPT ); Mon, 1 Mar 2021 14:21:44 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4344764EF0; Mon, 1 Mar 2021 17:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619455; bh=3deFDwrKRhdBOc4SDHrhoASfKkSjLcrrSCmY1SwCKrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FN1BdQCNvxTK9P87Y1DbTTS+4j/HwAxk/afDLgqu66TuR6mrWRimds62TJiN9UB6c cHSzj3mCSbpzkGmO4/peUplKqZLwnnstg8hAlQENBpzHsQE6u74+IY+x9yN17ZQtsf MSsWMGn0p32h5ZWUUOpRJUqzH98ktJBPaXzqd0rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shiyang Ruan , Joao Martins , Zhang Qilong , Dan Williams , Sasha Levin Subject: [PATCH 5.10 431/663] device-dax: Fix default return code of range_parse() Date: Mon, 1 Mar 2021 17:11:19 +0100 Message-Id: <20210301161203.212918760@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: Shiyang Ruan [ Upstream commit 7323fb22f05ff1d20498d267828870a5fbbaebd6 ] The return value of range_parse() indicates the size when it is positive. The error code should be negative. Signed-off-by: Shiyang Ruan Reviewed-by: Joao Martins Link: https://lore.kernel.org/r/20210126021331.1059933-1-ruansy.fnst@cn.fujitsu.com Reported-by: Zhang Qilong Fixes: 8490e2e25b5a ("device-dax: add a range mapping allocation attribute") Signed-off-by: Dan Williams Signed-off-by: Sasha Levin --- drivers/dax/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index de7b74505e75e..c1d379bd7af33 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -1046,7 +1046,7 @@ static ssize_t range_parse(const char *opt, size_t len, struct range *range) { unsigned long long addr = 0; char *start, *end, *str; - ssize_t rc = EINVAL; + ssize_t rc = -EINVAL; str = kstrdup(opt, GFP_KERNEL); if (!str) -- 2.27.0