From patchwork Sun Nov 30 22:23:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5409441 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D37439F1CD for ; Sun, 30 Nov 2014 22:23:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E889A201DD for ; Sun, 30 Nov 2014 22:23:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C737200F3 for ; Sun, 30 Nov 2014 22:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752227AbaK3WXd (ORCPT ); Sun, 30 Nov 2014 17:23:33 -0500 Received: from mout.web.de ([212.227.17.11]:63149 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbaK3WXc (ORCPT ); Sun, 30 Nov 2014 17:23:32 -0500 Received: from [192.168.1.2] ([78.49.11.120]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Lc8Xx-1YMKeh1gKj-00jWug; Sun, 30 Nov 2014 23:23:26 +0100 Message-ID: <547B98D5.8000909@users.sourceforge.net> Date: Sun, 30 Nov 2014 23:23:17 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Kyungmin Park , Marek Szyprowski , Mauro Carvalho Chehab , Pawel Osciak , linux-media@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/1] [media] V4L2: Deletion of an unnecessary check before the function call "vb2_put_vma" References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:ut9f10+9aqj3lJX0AcCCM9hIehPQYDnvtj19yPHFJxiTXgkZyxT Mrw1FlmCSFVEk4qy63onzQCMNFcBwT/n0tGiaMPFk5tNeYi1rp7nRW31NXnISMJPg9klbnk yMaFSbZYTVI9nf20Qev/K13ZIUXQzKe4QgU6LKKozE4Cf7VdbfUHKee7RITIgIPDIg+RhBt 4Uk+jQcOrU31x44H5BLRQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 30 Nov 2014 23:10:51 +0100 The vb2_put_vma() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Acked-by: Marek Szyprowski --- drivers/media/v4l2-core/videobuf2-vmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index 3966b12..fba944e 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c @@ -154,8 +154,7 @@ static void vb2_vmalloc_put_userptr(void *buf_priv) } kfree(buf->pages); } else { - if (buf->vma) - vb2_put_vma(buf->vma); + vb2_put_vma(buf->vma); iounmap(buf->vaddr); } kfree(buf);