Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp473156yba; Wed, 15 May 2019 04:45:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwavxynkauFmHlJH+zNcLVl6mFwmPIPCskC2Pp9F3N2pF7J8/BPG2tMW+/ldAVEWCcBXMOj X-Received: by 2002:a17:902:b614:: with SMTP id b20mr41469069pls.200.1557920753334; Wed, 15 May 2019 04:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920753; cv=none; d=google.com; s=arc-20160816; b=nCxI5oCkkDCbcy9Y4P2Tf6zQb1QABXges9YoxNPkbrsjSEkKbK2LrQDBblM0mDiefu I8BiZUy+6MPeTXVpWZVDBh+I+o70pUWlyagfDCFBPo9jE3eFtk/1eUKS6U3pt6++fmtN WwFkGE8vhxCkw7EQx08FtQsUV//htBFzzWL5mDl/gdj+yHORmpkeoeg1f8hjcjnhDlrb X+dNWF2ozQZdZId/7Owp1L/HJNdbOclRqoapRk/obnxHeWWNDw4EHQUHF9P5JTM9CkRX +sWEoIlhakYkC9JmgtvAVMWjNiCTspGTOP663WED3ZibS3sKmSCFMJRqd6+e+8ClUIkl q56A== 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:dkim-signature; bh=Gt4j3ETSFih9x8gIMrIu7QaEoM+SuP+0QWhiS0OTjkw=; b=DFbaNoGTwFzUBYCkD3tlVpSs7LuggmjRNBp36R04EnuuY8iYRsJytbBMVqRkfqIFPq 8SB1pR8J3NGt1+4eTfJse6O2IscnYwHqZU/ruT/8IG5V1IiPlmGKfNv4vRPz+4khfemc y524iU1FE/esVbbq5KoBrcYsSx+Nb8KoiglMmxJCmClgTNVATZ7UBUFloOXjuxM7p/oj RbrhM0E2haigjV/l1aTCldAvmJWs8pcCh9Cd5q4vW1/MP2TIX8zrXeC5JYusHIavt58h DuafabOB1VuP35bmV/aos/RgP42GFmggwuU4K67GGf4fG1I8lKkda43U43+U9LXt0Bvd iMsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zbSsGYeM; 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 w67si1931218pfb.125.2019.05.15.04.45.38; Wed, 15 May 2019 04:45:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zbSsGYeM; 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 S1731973AbfEOLof (ORCPT + 99 others); Wed, 15 May 2019 07:44:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:37348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728903AbfEOL0b (ORCPT ); Wed, 15 May 2019 07:26:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B22C7206BF; Wed, 15 May 2019 11:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919591; bh=pL0hkTf2rl78dlcSOKzwSlb/2Hh1mO15LS8IoPCp9ww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zbSsGYeMmVqMqpBEKwjW45hc4bxd7+avvhRn77+4h6MOONSNbfiAm8h/jLTO8Zfse wUsP3e6Bxv1NPTqoEmUowzWkgCB5Wt2O1OFhmq3I43+qRfOb/b+NwHUeqnNuR0zMRb kS0wpsOtjLigWhRgiiNAzQokvSL2eDCaNCaMz2Hc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Kees Cook , Andy Shevchenko Subject: [PATCH 5.0 002/137] platform/x86: sony-laptop: Fix unintentional fall-through Date: Wed, 15 May 2019 12:54:43 +0200 Message-Id: <20190515090652.050120540@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Gustavo A. R. Silva commit 1cbd7a64959d33e7a2a1fa2bf36a62b350a9fcbd upstream. It seems that the default case should return AE_CTRL_TERMINATE, instead of falling through to case ACPI_RESOURCE_TYPE_END_TAG and returning AE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense: return AE_CTRL_TERMINATE; This fix is based on the following thread of discussion: https://lore.kernel.org/patchwork/patch/959782/ Fixes: 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct a } return AE_OK; } + + case ACPI_RESOURCE_TYPE_END_TAG: + return AE_OK; + default: dprintk("Resource %d isn't an IRQ nor an IO port\n", resource->type); + return AE_CTRL_TERMINATE; - case ACPI_RESOURCE_TYPE_END_TAG: - return AE_OK; } - return AE_CTRL_TERMINATE; } static int sony_pic_possible_resources(struct acpi_device *device)