Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2285760imm; Thu, 7 Jun 2018 08:12:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoOoxeTfFV1jHBfRS5BFH+0SOrZiOESih5KIFVepsz0OVXYLBC7WOcLI/l3EbErrNh37/8 X-Received: by 2002:a65:6205:: with SMTP id d5-v6mr1941737pgv.416.1528384323643; Thu, 07 Jun 2018 08:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528384323; cv=none; d=google.com; s=arc-20160816; b=iCgf10bfrjL6LlGEJXKfdr5XKB0kFShvOojW9+o/5O7408Cm38V7bMDAxPg6V4g6zq s1RPXaN882Z5SRFrwPwiN2l8R0W5gQQdNgpnbRAFAQKPPLTJEOU59cBgVjVffA9EQRvY N9PlKVUKvIAjfYavAUs7N5wnOak3CPepWfjoFXjIgEf/yDXS/lKZAZWtop13D7Mw3PWO AAkrfp8BWHaagfzTzDxSY9zDlwwOCFLubQPtdS/gfyWAqgKBsYtnYSc1XEX7JFzZRHze rMYJrCQ/Mo87HV8LM5IZr8XK4tUzt7hBbDXtthTDFS6SiMq9CuognmNfJohU1EI9fm5g EUCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=IqlFaTti9nk+axLewwZxwop0GUWpsokqT352NTpHeBM=; b=uHmasAvK89hKR1Vu6uLF3gkHK2/C2cIXzStmaVZMWw4tkb7nXcLaJwA20MtpnBiMkR nfvanRRWR53on4OUx54Ad0b281oNqeuUoEDy56ZlFHO7DOZVTKE/WiEx5igEOAQshTQE LAA24q7BHtuDkfRMTOvAI+nf0lSwPPXrlPWbNYK16qa5pof04ysSddJ+lsKOoheVNm1d qVhniI6/9PQW0r5gPgD6JBCGkiS3TONbDSTWpcvSvCtfxpgVskRsicc225F6R5Po28gy 5n4GPL5YMCouY4Q3PIVuGRjxt2MyK7jW8ablBz+BSEj/Y3G7hDDX8DNKZzsUdJWvUtEj K76w== 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 f9-v6si2326487pgt.128.2018.06.07.08.11.49; Thu, 07 Jun 2018 08:12:03 -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 S965026AbeFGPDH (ORCPT + 99 others); Thu, 7 Jun 2018 11:03:07 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41478 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964993AbeFGPDF (ORCPT ); Thu, 7 Jun 2018 11:03:05 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbJ-0005Zn-1f; Thu, 07 Jun 2018 15:09:17 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvbF-0003Jm-GM; Thu, 07 Jun 2018 15:09:13 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Takashi Iwai" , "Dan Carpenter" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 403/410] ALSA: pcm: potential uninitialized return values In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 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 Signed-off-by: Takashi Iwai Signed-off-by: Ben Hutchings --- 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 @@ -1362,7 +1362,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)) @@ -1469,7 +1469,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))