From patchwork Wed Nov 21 09:06:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13033 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E0DE123FC9 for ; Wed, 21 Nov 2012 09:20:01 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 64F40A193B5 for ; Wed, 21 Nov 2012 09:20:01 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so2347871iag.11 for ; Wed, 21 Nov 2012 01:20:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=9p57PUjw0Xwl0rCrEGePBiuDtiTfQWUv0V3NVdnbjFI=; b=U3fzEVwyR+E61swedA0nfrwnenSjQGyYzcS6Cn9DATTl4aS1PjsTcTzn9gQd9c1wsF WJiZa7YMNDHPlL9bAStnpHFBSTJJlapICtCBGtcu+9S2YiAlaWxfPWkmImBGBPHAxgdu Iq2pzoGZVxfl0K6FNT+fgDd/go6QLGIV8TzbLW/f8MGpBxwmsXae/SFOO/WqDb0I7LUV 2u2bSTqRsZ9Jkvj8vSk5bmL2bNtXZmyWgGhf1x4Yu+Elt7YolQ+6u2GZuT+j7i4/PEbo k/a7JfwRUyFDomg3nB9c/jTEglAtQ7XrSKyr7YPWcg1c5/11Hl62CJoyAaJ/7vmOpA1E veKw== Received: by 10.50.213.69 with SMTP id nq5mr12844621igc.70.1353489601202; Wed, 21 Nov 2012 01:20:01 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp533igt; Wed, 21 Nov 2012 01:20:00 -0800 (PST) Received: by 10.66.89.9 with SMTP id bk9mr15854527pab.67.1353489222386; Wed, 21 Nov 2012 01:13:42 -0800 (PST) Received: from mail-da0-f51.google.com (mail-da0-f51.google.com [209.85.210.51]) by mx.google.com with ESMTPS id mo5si21845365pbc.268.2012.11.21.01.13.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 01:13:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.51; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f51.google.com with SMTP id i30so1267320dad.10 for ; Wed, 21 Nov 2012 01:13:12 -0800 (PST) Received: by 10.68.251.197 with SMTP id zm5mr56932407pbc.30.1353489192290; Wed, 21 Nov 2012 01:13:12 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mn5sm9621802pbc.12.2012.11.21.01.13.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 01:13:11 -0800 (PST) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: perex@perex.cz, tiwai@suse.de, broonie@opensource.wolfsonmicro.com, lrg@ti.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/6] ALSA: PCM: Remove redundant null check before kfree Date: Wed, 21 Nov 2012 14:36:54 +0530 Message-Id: <1353488819-13902-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQkqY/RBVUyvFtuatNk7jQqYAb16uthwi8ita4lN09lw7YYEldOkWM/HlQtheXEqUxFeN4Ne kfree on a null pointer is a no-op. Signed-off-by: Sachin Kamat --- Build tested and based on linux-next 20121115. --- sound/core/pcm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 030102c..61798f8 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -981,8 +981,7 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream) PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))); kfree(runtime->hw_constraints.rules); #ifdef CONFIG_SND_PCM_XRUN_DEBUG - if (runtime->hwptr_log) - kfree(runtime->hwptr_log); + kfree(runtime->hwptr_log); #endif kfree(runtime); substream->runtime = NULL;