Received: by 10.213.65.68 with SMTP id h4csp717662imn; Fri, 6 Apr 2018 07:47:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+o03c/BUIbFHj3S/KXKGG75IQ+94X1mn7mT1dcFv4+LRi2xPp7CJQiP4OYM3U5lKJX3XTU X-Received: by 10.101.100.24 with SMTP id a24mr17493856pgv.7.1523026030651; Fri, 06 Apr 2018 07:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523026030; cv=none; d=google.com; s=arc-20160816; b=iyuPdNGixMNqCne1iWNk+UbsigcX7EdKYpVTk+NHcZvXgtE9Z+xux/kwOQ/BocfMWg 8DLYhrsZ+KlvoSjDJu8JICeptqb+F/tgOQ5EMKT9wWiSiG2yNG59yBGbIcjCcn4dXjDM UayNJ84LQCeU4nT/Gqp0zp3AzB0kYdLyqzFvG7OvTpDf34kFqT3AeH3lVK38cfy9UG90 1iwY8pCwofL1DlySx3xC+B9VVuA6qYoQrObz6j2GU5SpoKxOpyb5O7gvv3bIBOzBKXRx RDH9UzbrPjfAxwD+QNpvuEr7UY86LjZwtF89ltj9XKZWUmjhQeUGPL4ph5MS4bsTpXo+ iosQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cVCEN8sfogjjJzl9yx2o2aLys0JVWBMIY29BRclV0IQ=; b=QsjyOk9VuV4L1z+SaDI00moNY5O0RfuMDUHDx3NT6iA6O+Yq0A8ILL8eWr7mYoboAh 7OYKhhq21Ab6WMoZpzGvxkKy6Dd2Gpy57skQxSewTKQEFvhDgXd1ubxqVnJqVOpp370C bF/conOP5vEFVasiuMpqiyIFw8Az1L6u6xAK9mnwc4jv6PmQJXZ+HzVaAFa5W2lUJTKC 3ALGH23rBwkDyCjyKFgkAxzTvHgnJVi+n41OPJ1rEYpJ7qg50g+eU04DOf2G+bm20mjm 6mWNh03VBCP3csJ/i1xDlmsyMe4MS/ZKt6SBA9L6VNjCtdz/Swpvdb1BXGh3jjNMkNii 4J/g== 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 t15si8012950pfa.170.2018.04.06.07.46.56; Fri, 06 Apr 2018 07:47:10 -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 S1755700AbeDFNdw (ORCPT + 99 others); Fri, 6 Apr 2018 09:33:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58022 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755374AbeDFNdr (ORCPT ); Fri, 6 Apr 2018 09:33:47 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B7982CF1; Fri, 6 Apr 2018 13:33:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Takashi Iwai Subject: [PATCH 4.9 005/102] ALSA: pcm: potential uninitialized return values Date: Fri, 6 Apr 2018 15:22:46 +0200 Message-Id: <20180406084332.205311261@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit 5607dddbfca774fb38bffadcb077fe03aa4ac5c6 upstream. Smatch complains that "tmp" can be uninitialized if we do a zero size write. Fixes: 02a5d6925cd3 ("ALSA: pcm: Avoid potential races between OSS ioctls and read/write") Signed-off-by: Dan Carpenter Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/core/oss/pcm_oss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1361,7 +1361,7 @@ static ssize_t snd_pcm_oss_write2(struct static ssize_t snd_pcm_oss_write1(struct snd_pcm_substream *substream, const char __user *buf, size_t bytes) { size_t xfer = 0; - ssize_t tmp; + ssize_t tmp = 0; struct snd_pcm_runtime *runtime = substream->runtime; if (atomic_read(&substream->mmap_count)) @@ -1468,7 +1468,7 @@ static ssize_t snd_pcm_oss_read2(struct static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __user *buf, size_t bytes) { size_t xfer = 0; - ssize_t tmp; + ssize_t tmp = 0; struct snd_pcm_runtime *runtime = substream->runtime; if (atomic_read(&substream->mmap_count))