Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp121931ybg; Mon, 8 Jun 2020 18:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbfMjXEe+4J2KUWtFEH+FKxx52KhsYbvShB5gk79aivFIoyVv3snm1pFg4QuPdIqNKjAxG X-Received: by 2002:a17:906:aad8:: with SMTP id kt24mr22918522ejb.527.1591665195894; Mon, 08 Jun 2020 18:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591665195; cv=none; d=google.com; s=arc-20160816; b=zIh2Gh4WzkPfIiMIzfSwIHqm6fw+Fl+Df9OyQ/C0p71j3aghAlI/mNuCYnwY+JOOWg ihHivv/T6dLGVwry2fzVgVq2G5JvKxJm+DX8sEyhg9sCROCsX1t7/OQd/obzQY58V4MM PjZ+xRpGIKiI4AegbDns0d1pnEUe9g9Hx2Ei5QXj+pdqzFfyV4JLDTmQhUMyLNEWRzY+ jjrq/amg/h3jn7KMCfxA9Pg05uXWey6acFO2U0urDmP/tA2IubHZuDEPnR8MSXSley8f z9UMPR1LPcwo1ifJyQt3y8yNXJBS8dsjKi7JD4HBT4akWzlBfDaS3P08EghgbKQsLJuC ZPyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JBo4k2n3zTrZdU6HlVqjKCAQafz4ucmE3rfHhe8JYFM=; b=N9WHpukxdqDtIN1AlGvsidZcAD6mlRMiiK3QxgaJiZpaz+Xks5eblEJDptHXP4N52M 70lRnopvp/ViEXJEfaRDt3NC12skajJj2kScakbUuctuvKlOzsOZNgPMs+xAwWBJvbY2 CmfqUgK3EQYSXN2x5dIZ9hLIb5MoZwrgOE54dlOk4K/PEstyiiAjD7wQDK2LR/hlr0oI 1x3vGrdXllaAnDWmSWIEYh/Lbe+71WGq6u/L+oPRg5sRxt88Dypikna9HOE+xoU2FrqF lS3Znfu15XoQr9jz170EBkSwOHw2fHR4NWvQc7FMMbQT41zI8oP++qGs9u0cLFOLWw5D f4YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O5eG3ktZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lb19si9866786ejb.295.2020.06.08.18.12.53; Mon, 08 Jun 2020 18:13:15 -0700 (PDT) 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=@kernel.org header.s=default header.b=O5eG3ktZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388235AbgFIBJT (ORCPT + 99 others); Mon, 8 Jun 2020 21:09:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:49786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgFHXGe (ORCPT ); Mon, 8 Jun 2020 19:06:34 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 822692078C; Mon, 8 Jun 2020 23:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657594; bh=rza3GijJEHiYQS6naUd/LTVSyFhudYeYmLttrcZ8jOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5eG3ktZYMifgzMt7m0OJalm0RkBxpin3ruCipnjkVYysg0fCbvAi2VkClacudXeL dQBuC5nVZPrtyTWSZu66XrHe6ElomP9UtCc3h7qwheqiU/cLXWuLfLN93hVyGDhQnS wxi7uXBGm9H7trsXE7Jupq0EEZSyUXlpHR2IdxnA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 021/274] net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name() Date: Mon, 8 Jun 2020 19:01:54 -0400 Message-Id: <20200608230607.3361041-21-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 2ac757e4152e3322a04a6dfb3d1fa010d3521abf ] In case of error, the function gen_pool_create() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver") Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/k3-cppi-desc-pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c index ad7cfc1316ce..38cc12f9f133 100644 --- a/drivers/net/ethernet/ti/k3-cppi-desc-pool.c +++ b/drivers/net/ethernet/ti/k3-cppi-desc-pool.c @@ -64,8 +64,8 @@ k3_cppi_desc_pool_create_name(struct device *dev, size_t size, return ERR_PTR(-ENOMEM); pool->gen_pool = gen_pool_create(ilog2(pool->desc_size), -1); - if (IS_ERR(pool->gen_pool)) { - ret = PTR_ERR(pool->gen_pool); + if (!pool->gen_pool) { + ret = -ENOMEM; dev_err(pool->dev, "pool create failed %d\n", ret); kfree_const(pool_name); goto gen_pool_create_fail; -- 2.25.1