Message ID | 1390560804-31135-1-git-send-email-sachin.kamat@linaro.org |
---|---|
State | Accepted |
Headers | show
Return-Path: <patchwork-forward+bncBDM5LUP2XEPRBN4ORGLQKGQEBPVNA7Y@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 90F15212DF for <linaro@patches.linaro.org>; Fri, 24 Jan 2014 10:58:00 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 20sf12658818yks.0 for <linaro@patches.linaro.org>; Fri, 24 Jan 2014 02:57:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=VbSc419St4dJDnTxIHE0mIMuHgzQCxeJ4TL2PVcyi9c=; b=F/Alpynih0zqQ/9Z3hPTXUPZA1ciNRelkuSffXV5ohdMaYvzTz0223kL+z7/aebHb1 to5pOosfzmSbUH/TVrSjXMeD9ckBVd4+ZIdQzgBJYFOKwFlqskxLE0VrXtJhq+g7EeLp 38zQhtew7+ig0gkTAQXXWISEXiuMcOoUGiSTJ3i/eH9DAPZm6X9eKHrYvWYhhlsMPOy2 0W+Y5sMIZFUdhc+LWExCaCAZe2d6+hUBWyNHzj8FuZ3a61Uyg8yw8UndEYNmqy2HSvBy eFHJZr8jl9nNDZMgrNAJV5oOubxInaMO3x3zVLyssYCcCzFQfH3lLuc7+F1lRSW7ufeN rLug== X-Gm-Message-State: ALoCoQmaG9IlRHGLoa18IJ8LZKErn8WMVXc0LDfItKD1kEt/tidnNuf3tzY7TmpB3oLXcESHc46s X-Received: by 10.58.34.142 with SMTP id z14mr4739108vei.23.1390561079778; Fri, 24 Jan 2014 02:57:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.199 with SMTP id d65ls538220qge.12.gmail; Fri, 24 Jan 2014 02:57:59 -0800 (PST) X-Received: by 10.58.146.5 with SMTP id sy5mr1511232veb.43.1390561079678; Fri, 24 Jan 2014 02:57:59 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id j5si300994vcg.89.2014.01.24.02.57.59 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 02:57:59 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id p6so1769928vbe.34 for <patchwork-forward@linaro.org>; Fri, 24 Jan 2014 02:57:59 -0800 (PST) X-Received: by 10.220.131.210 with SMTP id y18mr6905237vcs.12.1390561079611; Fri, 24 Jan 2014 02:57:59 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp93252vcz; Fri, 24 Jan 2014 02:57:58 -0800 (PST) X-Received: by 10.68.159.228 with SMTP id xf4mr8271937pbb.74.1390561077454; Fri, 24 Jan 2014 02:57:57 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id va10si753532pbc.38.2014.01.24.02.57.57 for <patches@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 02:57:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id lf10so3126434pab.32 for <patches@linaro.org>; Fri, 24 Jan 2014 02:57:57 -0800 (PST) X-Received: by 10.66.121.164 with SMTP id ll4mr13966705pab.48.1390561076956; Fri, 24 Jan 2014 02:57:56 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id de3sm1969516pbb.33.2014.01.24.02.57.53 for <multiple recipients> (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Jan 2014 02:57:55 -0800 (PST) From: Sachin Kamat <sachin.kamat@linaro.org> To: alsa-devel@alsa-project.org Cc: sbkim73@samsung.com, lgirdwood@gmail.com, broonie@kernel.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/3] ASoC: Samsung: Add NULL check in i2s.c Date: Fri, 24 Jan 2014 16:23:22 +0530 Message-Id: <1390560804-31135-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: <patchwork-forward.linaro.org> X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe>, <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com> |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 92f64363427d..a9da24f34834 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1268,7 +1268,8 @@ static int samsung_i2s_probe(struct platform_device *pdev) return 0; err: - release_mem_region(regs_base, resource_size(res)); + if (res) + release_mem_region(regs_base, resource_size(res)); return ret; }
'res' could be NULL from one of the operations above (line 1243). Thus check 'res' for NULL before releasing the region to avoid null pointer dereference. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> --- sound/soc/samsung/i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)