Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp140802ybc; Mon, 18 Nov 2019 22:03:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzoF/mwXniI3xq2W2X4Y1KbLOKoU7m1JahzRfTyVmir4qNLaybiainxzK2L4TonfhiHi1K8 X-Received: by 2002:a5d:4584:: with SMTP id p4mr25682624wrq.345.1574143418441; Mon, 18 Nov 2019 22:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574143418; cv=none; d=google.com; s=arc-20160816; b=yIQtwxvm6c7pVNd7Dh8LUPWR52Ki2pzJn9XcTYuzyKJuV5vdUEOOkDpPcPn6m77TBn pv+pi705D0msqzJKD0ApMQPxUT9DHWDKkWbTe2wIP4yQqSwcTr+zWH1n+7wIVyc4cIkB Hugunx95G/CpOPFPAOQv6/udAeru70IZTh/61MQjSaTvi0iWM9vSxJoHLAqCk5w+b8Q5 VvjXerE6R/+OQbPsQ/ru3uTHyRmYNMXf64vynUWdai7bO8z1tCjSFrOsS7/WIV2TmLMV UerXp2pXDACugX37Nv/SqSsEWc3kyLhkchMXMVr9MEabHMc/GTYddLpo9P+PsHWrURUr t7CA== 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=2TFf3kBDeXZOhbkAnsvALwJTNMWfJe0PR1ndUKGZkMg=; b=sm3N5TFpivgWbGaCU2utbNPhgWHwNamidIDNLULCEdQ9PvS60QNNcGOsBSN5csPqAa ddNdQzTKDmY5PVUfOyMK4UGFbn9PUxI0wa8CQjL3RVGqj5EVvem9eNTHnzqmt/Cd0OFU +vpDTK42CDLx91NT7QFbjAUlRRAphpEjorVVwFNXDkCMqFfOZ6SXe6SHowbTdWq1ImDX QeGW1g7ZojDPoNQa2J/2OhykAnMT9n1elydMC3bmwvAhi52UMzbYPy7ZfSRv0qaRHjdF 0buVtUpAHjSjRyn4hFl+nm+caUh5QD8nntzba6+jF+klZnwPRMkREt8y8WPztYxb0PQD tAgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=myDBQxiB; 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 q6si13923135edr.194.2019.11.18.22.03.12; Mon, 18 Nov 2019 22:03:38 -0800 (PST) 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=myDBQxiB; 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 S1730916AbfKSFpF (ORCPT + 99 others); Tue, 19 Nov 2019 00:45:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:40624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728024AbfKSFpD (ORCPT ); Tue, 19 Nov 2019 00:45:03 -0500 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 6366E2082F; Tue, 19 Nov 2019 05:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574142302; bh=n+9XzrVxtEeVuhRwZ4HPS0if8MXX+eA8pGGYJcSjOfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=myDBQxiBHue9sFQVefLQsuEjqU1kikSdyJveLEqMRLXUxjipa0gj2y+IrE910TSNA pIe6fAd+AQg74PIUnjyGHYAQtRC3Ok9VviBaHj+XRcOULn6QFTJoHHav7wFIzV+WBH jzpcdlTzZsegQpF+5cpTuGNid7T7gQvUE3semer8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Takashi Iwai , Sasha Levin Subject: [PATCH 4.14 034/239] ALSA: pcm: signedness bug in snd_pcm_plug_alloc() Date: Tue, 19 Nov 2019 06:17:14 +0100 Message-Id: <20191119051304.154353444@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191119051255.850204959@linuxfoundation.org> References: <20191119051255.850204959@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: Dan Carpenter [ Upstream commit 6f128fa41f310e1f39ebcea9621d2905549ecf52 ] The "frames" variable is unsigned so the error handling doesn't work properly. Signed-off-by: Dan Carpenter Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/core/oss/pcm_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 617845d4a811b..b8ab46b8298de 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) while (plugin->next) { if (plugin->dst_frames) frames = plugin->dst_frames(plugin, frames); - if (snd_BUG_ON(frames <= 0)) + if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) return -ENXIO; plugin = plugin->next; err = snd_pcm_plugin_alloc(plugin, frames); @@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) while (plugin->prev) { if (plugin->src_frames) frames = plugin->src_frames(plugin, frames); - if (snd_BUG_ON(frames <= 0)) + if (snd_BUG_ON((snd_pcm_sframes_t)frames <= 0)) return -ENXIO; plugin = plugin->prev; err = snd_pcm_plugin_alloc(plugin, frames); -- 2.20.1