Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2497528imm; Mon, 24 Sep 2018 05:29:32 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbho8Ox4NkZjgtxf0Fw7Q2YpUtjlwLh2hlRPqpCnsW7tvvaHDqJhHbuYZ4H0M+6nCK+01Yj X-Received: by 2002:a62:b209:: with SMTP id x9-v6mr9869988pfe.148.1537792171998; Mon, 24 Sep 2018 05:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792171; cv=none; d=google.com; s=arc-20160816; b=y+INoPgObGXL+BfN5jdDpEFrn4ymObx/vthyVGwXUukEjgAoUeT/wQNKBBjby5tm4k 61ZL8zWHlqM6y9E4ISdGyzvcCcs9ET0mmnt1HAsrF9+juFWKhTmiluSfu4+hPtHglfZq I6ozOEQ8BwJmHiZdiWJgQFB0+sYTtnibzYLqmtZr1Oya8/sTAbWeU7svOZWREGEYmqEt pmXQx3uo7QkEioRnZ9GEjjPhJSf6usOUlV4K010C/H0iIGo4D6rbgLE+kZD5o9pIsClR AcRQg7T7usXMx7cxziZMEJSZX0YBLAYWvKUfZ+uYtSVt+g9MWOjut64liysxgV7D0Gnn 5YGg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=gyPenjCdnGj6QeaPWzo7svbe8vFC7kPLNUeMZkY2wb0=; b=Xwu3AZ8efTLRXuPDMMpXDZv04rtBEvH+IHYgufYEHmoXpgiLp5nZSDlZbfa/IcJFfu Vh+wWl7sGPrDv47IednqXgIBSv5ojSKW+wxY8/eqiTYCIXcKoPv8lxlGIZJ8uf0zupDW 5RYyhZseIva2R3M3t8WZpjMu0X7Bgj6dP9ROMrhOZITxN71fFQurvD8tCJ1oQpt+AKp3 NsgziX6alb6hUqOsA2LecXhaDfKTLIr7Wye8c/R87sI9e6PVYpnWxzHHxv82lh1pn8JZ 1YmmaIGAZE13n6eQ9jN4mJBFnDmUZl+cSACl51BWvqc8vShS0BvYEaQ2D5vZGOkZ3TTK N39A== 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 c20-v6si590892pfc.18.2018.09.24.05.29.16; Mon, 24 Sep 2018 05:29:31 -0700 (PDT) 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 S2387526AbeIXSaP (ORCPT + 99 others); Mon, 24 Sep 2018 14:30:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57432 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730233AbeIXSaP (ORCPT ); Mon, 24 Sep 2018 14:30:15 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C7FE91097; Mon, 24 Sep 2018 12:28:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Gregory CLEMENT , Stephen Boyd , Sasha Levin Subject: [PATCH 4.18 030/235] clk: mvebu: armada-37xx-periph: Fix wrong return value in get_parent Date: Mon, 24 Sep 2018 13:50:16 +0200 Message-Id: <20180924113107.843318939@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gregory CLEMENT [ Upstream commit 616bf80d381da13fbb392ebff06f46f946e3ee84 ] The return value of the get_parent operation is a u8, whereas a -EINVAL was returned. This wrong value was return if the value was bigger that the number of parent but this case was already handled by the core. So we can just remove this chunk of code to fix the issue. Reported-by: Dan Carpenter Fixes: 9818a7a4fd10 ("clk: mvebu: armada-37xx-periph: prepare cpu clk to be used with DVFS") Signed-off-by: Gregory CLEMENT Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/clk/mvebu/armada-37xx-periph.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -429,9 +429,6 @@ static u8 clk_pm_cpu_get_parent(struct c val &= pm_cpu->mask_mux; } - if (val >= num_parents) - return -EINVAL; - return val; }