Received: by 10.213.65.68 with SMTP id h4csp673932imn; Fri, 6 Apr 2018 07:07:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx48cTdcTAg0gbUOxI0nmO1VDCkJX9/kd+bHH9u4iqn1g+mZVKnzy6WNhexmNjadj//Lk1EK7 X-Received: by 10.98.103.69 with SMTP id b66mr20425124pfc.151.1523023649596; Fri, 06 Apr 2018 07:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523023649; cv=none; d=google.com; s=arc-20160816; b=PScD3DDFqPZuLIJhG40q43kSxGV47ACM9MrbisHCw5xjCozi8x9trnIkMsuSQuVJnp Sk3Ou4m8pDvNMNnVnViy8uZjJiN+vXp7oatQWgcsmN+CV8qI4aHq2FyLvOBVkFQbzeVf tOqo7Lu+qZj0N//Plr+e48ewt1h3O2ihteXRcXxIK0c2kEebsksV32456EAu64yTp4+x 3RIn9uwIxA8Nxcqg2m1+X0fh9vCf1FRe4kn63cNSA61OkOQyGeWAqcX+r1ksdN5t6Fd3 4ic9o9KCeJSnuPr5n/7+Jxc+zqXmxpMFtI+RclI3cmYC4B5C5PUPMKNnVMl2N1mmhgdl VU8w== 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=QxnL1sBD1DKWP4B5QoU1XCFO8+KfD0vuahhWtQUCHWw=; b=YnpB56zB2juCxpq9bTPRIG396+WRw9XQFWU8/nVqHKv5B4a8FqKxnADg7B7MFztAUr jkxi4yD5XK+vA8Uf45jC1+wbyWpQCorRGY3vv42TgzhKmXevjPzS+vYzYF7pFi4c+uC/ 6P+htc/nV1kAWvtKtyYm4yRoNPXJ8gqZ2gggRGC51dP5h4Y4MPBTrqRkIHd3MnCIFjme mrUMX0mEaeJLk2EDcKjnTjSazihdtoJtlnDxgE0UjExna6pHuTVa4G0NPhTus0uW4d2A vPDJrYYAklkiBHMh+gTS/WttLxrvyoY0m3LnEqfETC3mNAbs+q+rQrGwjZ2S/T3tDo6C ubhQ== 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 q7-v6si6420375plk.129.2018.04.06.07.07.15; Fri, 06 Apr 2018 07:07:29 -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 S1756439AbeDFNl1 (ORCPT + 99 others); Fri, 6 Apr 2018 09:41:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36228 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932873AbeDFNlW (ORCPT ); Fri, 6 Apr 2018 09:41:22 -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 2E102D96; Fri, 6 Apr 2018 13:41:22 +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.15 09/72] ALSA: pcm: potential uninitialized return values Date: Fri, 6 Apr 2018 15:23:44 +0200 Message-Id: <20180406084350.274923949@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084349.367583460@linuxfoundation.org> References: <20180406084349.367583460@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.15-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 @@ -1326,7 +1326,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)) @@ -1433,7 +1433,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))