From patchwork Fri Jan 28 11:20:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12728250 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3FDEFC433F5 for ; Fri, 28 Jan 2022 11:21:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6DD361734; Fri, 28 Jan 2022 12:20:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6DD361734 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1643368884; bh=Phwu77UuVsNxqTOju3mjxkLP5Suk0dZ+bKR5rYFJRvA=; h=Date:From:To:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=LLiOQCqOdWFZiDF0ZaO3zp+kr0LrlmNsjEcWwiX3ExvSHROfhnnXxeG7ZcSaBN81R 1z+8EVKpDv3jf+uQgq3HbwK05WFTqB5TaZOx0UftYaFlhGWOIS6LJ1AjIDtEsJGpT2 Mzd8BA3uOyqCoJl3uUVdOjhHtTCmSRBpCYaccWfU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1B198F80240; Fri, 28 Jan 2022 12:20:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5FC93F8023B; Fri, 28 Jan 2022 12:20:31 +0100 (CET) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AF86CF80118 for ; Fri, 28 Jan 2022 12:20:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF86CF80118 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qPpn/CN8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="LXxDsGjS" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20SAmY8o015087; Fri, 28 Jan 2022 11:20:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=/KVq8F7H2YHWnnebdvpkhaAac+zupkwZpGAJOQ7+xo0=; b=qPpn/CN86q83kqLPs9Tuqe9pDYkQ8jdXGHC8fe2T4RfUv8xnny6LGPvjnPRtbxl5RrtJ xmJN24iD57CO5w7Frn98tY6cgcgSY6LsjqxpkScoO44ejXR4fSz6FGTHayAAe3kFeNDE JYQYwuFkgHObDLosP5fJ73uvEAZLuy0ZalNF21k36lNAbWce+p+1py75KWepnqoDT4+I OsxBGn1sgkPkbT9BsjYHrGEG2yWCYUqXuI51YMmdnYRhhbfM4tCIvw4hV8MrhYuTSIXL nBcbHmjlE7KMva5K3bnTyWT/nCp646V9eMQSLSyGN0OcpNO+qwxVfKQANMK8Fm39Mkp0 tg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3duvsj2xwy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jan 2022 11:20:24 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20SBHBbZ013265; Fri, 28 Jan 2022 11:20:23 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2168.outbound.protection.outlook.com [104.47.73.168]) by userp3030.oracle.com with ESMTP id 3dr725dakx-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jan 2022 11:20:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvNaxUeLZITv3+vALurWDcbqZC0TY7S077HLcPvyG34fYi6qFFuYma2Z4Mo6tHTMO/ZuJgTEA/lQMfTd6J27hMDwkZer5cwJvOO+uboN96vAmZZp6zVTfhXfBXO+jhp9+/tcMuk79+w5c1uIOEj8QB6VPReBX6njFDsHq8roH0G9ylEXG6wi8nxiBdRPGbIf+6tNZmV4falr3ICEekpKo6VqS6BcCYP4l0plbQzHtlLLqJxO04ApOPsu1S3HedcetvDU4uXeYQoFqqZ9FR+qJEuL7fACZCYnhg2X1gsnPxuMFSkV708xvXpiQFqysA8hcCP09DejOr+tsqlU9bjmhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/KVq8F7H2YHWnnebdvpkhaAac+zupkwZpGAJOQ7+xo0=; b=PRtZE/tvsXLKGwrm10KWIRomFZSnFnG27f4Xc1GTgv7FQ405TtfIdOO+t3jK+5VKyqYXN0dT7eOFMcsaz0Db2+PnfVWlV32vZuXZrK6GGTtaUsiG1RqAldD9cHTEe8CCYVkscVYPWkvhlgRw+opbdpNIKaNUWzTlZgKqnjw9H3pni0HXU5S22m5vPmWesFijDeqZ33zcAONLaz+mEu6Z12pQ02qEaOBH5bEJ+8IA5Z47QjI3379cRyFIy/qFFfI+Ea59I4GRRZxqit7ZbPZO0dZ+Cywiabs5yq1tYi+hADLJgDBorFBPjhwTNHTDXytPfkTut2wk6HRcfRiP2FR5rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/KVq8F7H2YHWnnebdvpkhaAac+zupkwZpGAJOQ7+xo0=; b=LXxDsGjSUzeEsIWejmhI/0wCK+6+6NpXzVXatScDwWIXH/Os8Bm1obttapUdjWwISDK9jTvJKLEg0ihCLHEraJsNxwlRXtjvFv42Ai7/KI5s+T3y8MX1QPeaQBJp9/1a/L14MiyH1PS34l6bO+OGV0t7gfFtsaw36Q80ai6paqI= Received: from CY4PR1001MB2358.namprd10.prod.outlook.com (2603:10b6:910:4a::32) by BN6PR1001MB2097.namprd10.prod.outlook.com (2603:10b6:405:30::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Fri, 28 Jan 2022 11:20:19 +0000 Received: from CY4PR1001MB2358.namprd10.prod.outlook.com ([fe80::cdcc:584:3514:f052]) by CY4PR1001MB2358.namprd10.prod.outlook.com ([fe80::cdcc:584:3514:f052%5]) with mapi id 15.20.4909.017; Fri, 28 Jan 2022 11:20:19 +0000 Date: Fri, 28 Jan 2022 14:20:07 +0300 From: Dan Carpenter To: Liam Girdwood Subject: [PATCH 1/2] ASoC: ops: fix signedness bug in snd_soc_put_volsw() Message-ID: <20220128112007.GA24806@kili> Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: ZR0P278CA0021.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::8) To CY4PR1001MB2358.namprd10.prod.outlook.com (2603:10b6:910:4a::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c738eeb5-8601-45b2-c6e7-08d9e2502a86 X-MS-TrafficTypeDiagnostic: BN6PR1001MB2097:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AZYJXfn6FH4IygNQXRQiENYqwLUtGSPGk3Oke2N2iZyoLvxyWCwN1WZhyea7zTJmaRPje6+DveUNy4/B20QIXiCdiqXPYnMirM2122UIwQP4uZZ3BS07pYpDauB3eHJXb5YRynTTPEgbWruq5n6T4aYfi8VfMEmXwx7Sxxl8Kjsd/gS7xE6NNi5634gLzvLQnJepc4DHl+wA+xLIUtzoRJ2BUS115cuKJV+X3n3lFGAURL7DbsiuMY0ER1fCfrazasMzpCFRYvj8mv6/eYdhjQlQZ8KJiAU4FcE1fbKfuH34MmPG7Kz//O1V1Kntm/3jx4MfNueQhoAXwr8IBXGjs4BzbqvlSryK9Hf9RfIP9xXjEN4UDZPHSUvqszujD4fxEgg0UvMx7foFe3V++oQaecEcHnEsAMl1ThV+68blv2dkhLlvJ8gEgjhNfa4pb1Be/ry/SqVtrodnQI6TLN82ciyNzwlGc+NqGihqIuPfiD4Lb6OyK6a31q9jyopCGcLI44E1nf5H1g11LbqUONmOeA3U3lIYoUKRZQUfTuf5L0hhXpXpR6iJNfJwh7eNHWg0hdW82EvaQM6yqaq7w+r1boV35xTLbSpO373jOkGgM1U+f0j2AWoP6OL5ia1SqpBf1S/hsFsYjqKetQXWf83jE1YHnTZLiTQD3/QfiobG69Ow8lTbsHzy3MlFDFvCV8ThMW2W6PWgReTQeHHqmB6swQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1001MB2358.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(7916004)(366004)(6486002)(6666004)(4326008)(8676002)(508600001)(8936002)(316002)(6916009)(33656002)(54906003)(66946007)(66476007)(66556008)(1076003)(86362001)(83380400001)(44832011)(38100700002)(4744005)(26005)(5660300002)(38350700002)(2906002)(186003)(9686003)(6512007)(52116002)(6506007)(33716001)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6PnzJE2wwQCSlMwfqaYY3XI0pk5I5rIWG/2Qk6PwPOzdRALM5QE9YvGw91BjoxWn8fHi041nsHaOJ8gRb1iGD4X+O52o+BJ2b99Wi1pEaA00gwUraDx9sI5IhBOucJMsTJMVwPbAQ4DPtSpeus4DIWavfkZS21bODfpjtwFrdWUegitjoC28glOtg3+3Q04WDF7HLcXvzB9pEVvq22eYlP1uOItrx4zOBxhmKu9dpLD3uPi3yP2zy/SyloMOO99HBeTUxyta2npppY54gtFShfouDae00Q3nnKlD5G697mUsO+0DCS43hReoBmhTwkL5kKIyNYWpXcrwLDmbN3aa7g4Lo64dulKP9F6szWwLxWJFm+ubMjNb0yRlxM/Gnv3nuskaV9Lueoa4bWPReZeniNQPYSIBlETZJi1Whlm0R5TyK1NP/DEOUiI9+N7c4N8ptnrTwsceRq2pg3CHAHZXIfB1YYqf1S9ZZlweS9tD3mlIDeLyuPhMSFpXbcExq5443Bx2QMlpol6JusbSEMay98sOSIIOdm+kn0VeoLsqWtLAdz+DFyAA25h2R19W9gh2JGOiOaJvaYC6kCb48QQzSqaosxmoiVreeQtbeEUwGC4kZybJviJbbDLRfuzS3qxRHFpM3Ksoka9fzU0gRSmgtQ9JfiLLeknMeDIjdi9uAWaLqSrowbN/A9yZtbhqUny0+f/j2M9mm/q12wymKAS2aCQdDjjYMKnA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-AuthSource: CY4PR1001MB2358.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2022 11:20:18.9935 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ae9rLlyqiQJqwcx/YOL8Qpkfqkg7acYdrIIO+kcV6WcfOmLcdM+QIoaPeiNLc1eSlzaFtYRVC5zcCOgw56BjlwpA5I7TCMDa4G2qj5B6Jaw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1001MB2097 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10240 signatures=669575 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201280071 X-Proofpoint-ORIG-GUID: 4mxksvCo6O9nVJp_HBUcSLFpZpy0yV9S X-Proofpoint-GUID: 4mxksvCo6O9nVJp_HBUcSLFpZpy0yV9S Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Takashi Iwai , Mark Brown X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The "val" and "val2" variables need to signed for the checking to work as intended. Fixes: 817f7c9335ec ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()") Signed-off-by: Dan Carpenter --- sound/soc/soc-ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index dc0e7c8d31f3..0091fa96eb48 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -310,8 +310,9 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, unsigned int invert = mc->invert; int err; bool type_2r = false; - unsigned int val2 = 0; - unsigned int val, val_mask; + unsigned int val_mask; + int val2 = 0; + int val; if (sign_bit) mask = BIT(sign_bit + 1) - 1; From patchwork Fri Jan 28 11:20:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12728251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD484C433F5 for ; Fri, 28 Jan 2022 11:21:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0DD83172D; Fri, 28 Jan 2022 12:21:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0DD83172D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1643368913; bh=WdbJNUcefqkJ6jCijfqI/rZ8sOjFS9O2dM79FZVV22M=; h=Date:From:To:Subject:In-Reply-To:Cc:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=t0pp/tGRbYtRu0zQdBiLgVVxIMSetBAu0ESlycTi4WHshsH15cF+DDIyzx3jfv5MB 3jNvAS5TIKYckMlew8w+B/FW/4M8DHw7+t6BFlspcJ9fJFqHuXB27BZ1+RbqFUTwO/ CtqhmoY8DfXt157MWdgzrRz2IIFBhp0WlujmsGFM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A6D08F80249; Fri, 28 Jan 2022 12:21:02 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6898DF80482; Fri, 28 Jan 2022 12:21:01 +0100 (CET) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DF249F80118 for ; Fri, 28 Jan 2022 12:20:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DF249F80118 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GB7h5zgr"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="puk4zupk" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20SAmY8t015087; Fri, 28 Jan 2022 11:20:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=nO0Zj3ch+si17hxBqEXBozCdzI9tZT+y+U3e7dc6wVE=; b=GB7h5zgrSponLuBzKDMqDYnc5GcJPPP3kceVMkQq8AZksLylGa4YmEoQflOxjuJ/2MG0 xemXmSdq8eLUqU2WDTnZB0C31uIu/mm8Y5To4B4b9Vm2CtFnr1gf2UiUeBXnpQ1VzTP+ tAUXGiKjru43kmJJcfyeF7PB6mddEyKytVtr7it8U/GSvRD46BWAYRUnPPU9vM0sG0sq UqeiIQwm20v8/eIhNcfPH/EE4O9vSJwmVSMVmk1QzqmJN+Q7XiVyl+RU4bc912OlFytV ddHESSsk0RSGTvGj2R9eLks5C9DWuRkFYUiba2ymRG+YfSYbxf66x9/A5upfdmbydREQ LA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3duvsj2xxv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jan 2022 11:20:57 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20SBGtGk178176; Fri, 28 Jan 2022 11:20:56 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2171.outbound.protection.outlook.com [104.47.73.171]) by aserp3020.oracle.com with ESMTP id 3dtaxc7cvw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jan 2022 11:20:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESdpC94tcRoyuIeLfmXiC48LhvvrnRye9Rq771dN9id1FusojGJ+MJ6vBLT6XnCpj9RZCaLzzKzv5qr1CpxnbfI99TD0ceXjslhkh35Y0rAp61k8sGqkVIHADzib4oKLWZrYjFCwS1JW2VEg5qtUjUoMs/9HMKc398ZlTq0vec2mvcQlWyg0lzoBUU43hUH1bkYQY4POc9ISZkMmEPofFUOWhRovGq8hFfrZpAOxvfYy2p0b6bjtFzQ64P1Ixp8PAClYxHMJIaRK0FRmWpAuBLK5t8MuJI5uQNZaRVTkzIOJkImHSvJkM5b2aGE7GOjJtxsp/XbmlgKjTJMOnH08KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nO0Zj3ch+si17hxBqEXBozCdzI9tZT+y+U3e7dc6wVE=; b=EYGdrwjZ/BlCNgSP2WaPLOFBz6+p7kBX+PlFj1FwzYltiAa71S6RnUsjGzwF3dugxd4c9Ar2Myiu6QZ6g7dsYk8PKrWwtLnv+aqIcumELXwo8T97tbvkw6dEt9OZ5eiIEYbepGf9hX0nVj76EnD++mPhARmxAnWXglLd0ehVaqUeqz0+oACc/jFWVbQRyIRAkdctIzSwFddA6h7taOf474ri5SJvnwlQG3oGPbq+0z1lrd2K1sON/6R6EhsmMSAcgJ+Bj+ZTgUUFLDDsdaJy9tVjmtH6kq3bXTes0FWmnB5Xr7OPRDSDX+jYWlGhbsc59iFUIjhL+hiYaQUtWRI7XA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nO0Zj3ch+si17hxBqEXBozCdzI9tZT+y+U3e7dc6wVE=; b=puk4zupk5MQ3U/JTpcsysv1/gkUThzN0mGB5QPme5D4BkL4ztx9qTSpcngiAluMB3bl2yhg4oEoi3j+6PsRgAZ4OvLOH8lAqJsnt6aDM+4MRRKCMMYWM3dwml0FrwmwQOM2USv4FOt4H4kS25ABweT9aUQvlNyxeBngyJzYCwyk= Received: from CY4PR1001MB2358.namprd10.prod.outlook.com (2603:10b6:910:4a::32) by BN6PR1001MB2097.namprd10.prod.outlook.com (2603:10b6:405:30::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Fri, 28 Jan 2022 11:20:54 +0000 Received: from CY4PR1001MB2358.namprd10.prod.outlook.com ([fe80::cdcc:584:3514:f052]) by CY4PR1001MB2358.namprd10.prod.outlook.com ([fe80::cdcc:584:3514:f052%5]) with mapi id 15.20.4909.017; Fri, 28 Jan 2022 11:20:54 +0000 Date: Fri, 28 Jan 2022 14:20:42 +0300 From: Dan Carpenter To: Liam Girdwood , Mark Brown Subject: [PATCH 2/2] ASoC: ops: Fix signedness bug in snd_soc_put_volsw_sx() Message-ID: <20220128112042.GB24806@kili> Content-Disposition: inline In-Reply-To: <20220128112007.GA24806@kili> X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: ZR0P278CA0071.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::22) To CY4PR1001MB2358.namprd10.prod.outlook.com (2603:10b6:910:4a::32) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16b55965-905e-4a00-9016-08d9e2503f9e X-MS-TrafficTypeDiagnostic: BN6PR1001MB2097:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oavnfcD9aq1Ja0jJKA660/lss5iHU5tSTBqHCMecCMnpOC28aIS8HFw1z0vMQU1w8qKr/Zfx32zawZjlz6n0v/WEZMIqp8C+kqyCW4X7/1ZyeRO09VXqkBNeyRSCb/ZTH2OABpCTVIgxSXkO7PwMzO02tAtDDlF1GFzW0pWD69pJkgvl2W7jrwpWD27Ed98TGQtpPgLOe4eM2Fc2I6vGtQCsXk1D0eAqivKOuoXrmBwxT1oxrP99eDyuiKzy+BAG7V1xUZOzSceZMKB8E4EgIdrBbVOrvqcqQeW3JkBfLQhU1EjxkuINRlKF7nTSElWRP2Y/Te3+pfOfHeZhtNKreVcig0DhM/gp/+1049p+YXVv5slXbx2bshIIsNo83VH196W57Sa49FUK+TBH1taXJWiFx8idUR7TC4enlFTB+mJPKt/70DqLl3RfQ94hmj6QcTVL2rT7bY9Sa3utMZsjlV4LQKsO6oLFiz36iV1p37EUxDfwlKqbEDqB9lwfi9JFCC7ggi0LUraCXZTm+Ef4uC/Te5+NVVdD+RSQbq4kRbAQnAWmii0v+6plvXH1Ujjhgvjeg43JQesGrbh3/WgHSXsU9rFzxvVgW/UkndqGUxDYhtf4cLKpB7dfoAwL+wq1i5qxshyWUJcxQPNhmXqkRvc4HRIvy8sTtqr1mrY4pcUYp/9O2zu2PkUOP8P1c3YCKlOifUvFMTAw2jYqQDHofA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR1001MB2358.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(7916004)(366004)(6486002)(6666004)(4326008)(8676002)(508600001)(8936002)(316002)(110136005)(33656002)(54906003)(66946007)(66476007)(66556008)(1076003)(86362001)(83380400001)(44832011)(38100700002)(4744005)(26005)(5660300002)(38350700002)(2906002)(186003)(9686003)(6512007)(52116002)(6506007)(33716001)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +rHOWUycrlC/kFurmm3ZRoy5uCtx8429DBvsku3r106f1u+e1CaCqDf3W77Br5zif4Gi/+u6ZPYWZqs8VlAn5quWt3gKJiS8873N41WbPutXRapONDBBcfbiRtKAoghi0muA9JDT9/X3oBkPWsBd/6cNIDz9gUAwTC7eI5D5Tyu07lgXrXJ5Hj0HfcupiN1DOCIERE0RXD9DWSo3uUxqBVxW1LnZYJOz5NDs3OaemXvhI9t0zRObCrxSsWRbjRm2DUuar6E2KQsV6kkj6zF2W6sus4Ma2J/pl2LyIohF/vCVJJ53dzFLxjoUNY4Aafkxs5a3LnMrKrPj/uzTUUV6Y96m07eVY7KIdmbTTqlQxpPgSGZmLxqa7sXC0qKz0C74TlsTJi7L43zLDNR1diNAZflEV+nB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+/fT2VR8ppDgBuNDCi1ZX7pzXTNt+ON8EgLgRx4ke7sEmtnsOgejyLXxVj3X+pgWuxrBhktiS+6vBG6dtJP5EHobp6gM7i0hmMbkjQ1iXFcx0kn+9WBv3Nq4oUqG/6INqKtye7LJQ0SuvtDvRZ7ZAKjJY/334sB4mGI+sJrc1ifLdviPVJZNM27GQXUgKsIjsJqGz8HrCq6vj803G5pE7cAb00kPQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16b55965-905e-4a00-9016-08d9e2503f9e X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2358.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2022 11:20:54.3346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NNREjQdZc3lpT19Or7Xrhiz36mTIplQAdZJjpAg/RBsiytp2DMa508vS/OjkOyNeuqMf2h7jGhNh7J34tvva5CaF1S6DY9n+cOdSzIy9uSc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1001MB2097 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10240 signatures=669575 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201280071 X-Proofpoint-ORIG-GUID: nil_Oqh_GP9N9KE4aVIXt4wyG_0HeC2y X-Proofpoint-GUID: nil_Oqh_GP9N9KE4aVIXt4wyG_0HeC2y Cc: alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The "val" variable needs to be signed for the checking to work correctly. Fixes: 4f1e50d6a9cf ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx()") Signed-off-by: Dan Carpenter --- sound/soc/soc-ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 0091fa96eb48..a615316a06ff 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -422,7 +422,8 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, int min = mc->min; unsigned int mask = (1U << (fls(min + max) - 1)) - 1; int err = 0; - unsigned int val, val_mask; + unsigned int val_mask; + int val; val = ucontrol->value.integer.value[0]; if (mc->platform_max && val > mc->platform_max)