Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp325495pxb; Mon, 13 Sep 2021 20:45:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxud/Pxt0YgkKswrkBdEizcu+Kj9z/PdyEeRboWNwejlQ1hNaSt3MP/yMRWrf7yQxCDBCoS X-Received: by 2002:aa7:da93:: with SMTP id q19mr17398673eds.206.1631591152790; Mon, 13 Sep 2021 20:45:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631591152; cv=none; d=google.com; s=arc-20160816; b=z/ZoPBW3PAEYcx4c5SbNgJDp/w8M6v7N4X/3Af47WJcfr2866A0W6TTX6eG2MWWNVY M/zjeBpO/Uoie2ojTLyMb/dzA1mm377/UB7+cktjKR9zGF3Bt0fJi/5p6eDNFdMC3Q/T uxfw71i5QJb/cersEsNOedvVxkGtwj6h8m28X8IJOmdRAA6e5M6Wuvpg/HlICObwcp0u fDBkI94ckRvTRUXiXlN29GYPwxgPiPh5DBEAqz+/rKl5xWNJrl5atSh7jlALMRO21dZK iGpIizq/0YW6CP/ESiNjSVszCOCX+OkU2eUN+uki6X0Hpyu6J0TzVd4ivQG5FW3ly17u KmtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:user-agent:in-reply-to :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JbyQ7VGQk35fFKq+ZHXwnl3QOO9Lw+YzIfoAl5zBW0Y=; b=Ag9a1enbeqZ/+Tr5VXHMynW2jdunOb6sG4jZlccVQFrOQOSYMGrmsmW9ncQZHYG2j2 Lqnvb6NO+12nlq3JWgsvJNa/dUCxMPCqTfHOHIBwyoZySumlEtKaw0wb/VFD/oyapeBn 7si1S1PAk/I/tvEtarmSHF/kayq4pVABmmiNp+qRSlP5ULlQVjjXGP8FJTVhevju5YaC KkFZ6h9RBc3Oiz+dYGIOc6/z6KfW/dEuza7RuFAGhGjF4vS0IVyjbXt37khzT0mAe/Y5 4eqc48bJvXqE80PK319chUouGF2Xlhp5UIyhKcBCgsWKQJGtpermexRdqYXvuFDL5N6a VFCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pathpartnertech.com header.s=google header.b=jBZke60Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg30si9454022ejc.709.2021.09.13.20.45.26; Mon, 13 Sep 2021 20:45:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pathpartnertech.com header.s=google header.b=jBZke60Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238834AbhINDmC (ORCPT + 99 others); Mon, 13 Sep 2021 23:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239028AbhINDmB (ORCPT ); Mon, 13 Sep 2021 23:42:01 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B93BEC061760 for ; Mon, 13 Sep 2021 20:40:44 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id dw14so6981487pjb.1 for ; Mon, 13 Sep 2021 20:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pathpartnertech.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :in-reply-to:user-agent:content-disposition; bh=JbyQ7VGQk35fFKq+ZHXwnl3QOO9Lw+YzIfoAl5zBW0Y=; b=jBZke60Q/SiBooMIMQxd5Irr3YfUKyl/Y4jaFWgUsT66RmMrS3i9rgfh2Ud0y5PY/z NVk2Ar+iOzCEu4yReGS9MD0JwLXeP8/Cu6L78b3sFDT7vZPGx/+M8Ci/XrcrEvq/FXgr +Rx1QioGafI5R5oMNd+Av5b0sOcxGZrEwZAg8mVssbP8jyiThl70WryrVbIeozbGYp5v cm/ZQ4GtEd+wT1hH7Du7qbokadOflXuEx8jjIZ7WW/V5k96s7TrNicnPd1m0eVocYCS/ aj5aZjHYwgfXhIcHQBhvfEwxdx+5/YC53L98XhhmjEQPEcF2AQNEsbDYWvyz4SGsZ0jq lTgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:in-reply-to:user-agent:content-disposition; bh=JbyQ7VGQk35fFKq+ZHXwnl3QOO9Lw+YzIfoAl5zBW0Y=; b=huBJaluQA9q7/TzV7S6gI9DY38qdjf3yY0hZOsGPcDPwaGge3bcFLH6Mz0KoaDlr80 /NxldnlR0Oa9oODeuFZxSbDDVlgrcJb294oWi1iNR2sud9rCZZClbfI7PEWe2kuADPN1 9rf9EX9+KrqzsyEazFfXdHhnzE8p6z2Z3QMC8QVsBOCgwg2uvFW9p4sYQTKbEBdbLoyv +PZMqE9+1cFwN9C+BiGQZRfOXaiz5WfnMFl1WHkHM4Vntg4wcfoh0t1muZY7iWBEDA3j UMi9IgSG+AxjpPeahXmJu5S7P0of+Fs0cMU3Fj1SjZLyQzdLuMwEnNTL3h6uLoQMpPAy +AKw== X-Gm-Message-State: AOAM533YfGNtAAkVUCu/g5HT9J1PXWmIMoc4/1JBzOcvMhMrVnvjItv+ AMQlUaqv78jkLJAVzriLGq+KI8ZUz+4ifuNDPOiNn5KKMDjBZyZaR46TrYzaEpW584Mv9sJRKhv UDzy1WYleSp/v2nV44A== X-Received: by 2002:a17:90a:e386:: with SMTP id b6mr1280514pjz.97.1631590844188; Mon, 13 Sep 2021 20:40:44 -0700 (PDT) Received: from sidraya-laptopU ([203.201.61.238]) by smtp.gmail.com with ESMTPSA id w26sm476509pfj.178.2021.09.13.20.40.41 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Sep 2021 20:40:43 -0700 (PDT) Date: Tue, 14 Sep 2021 09:10:37 +0530 From: Sidraya Jayagond To: Dan Carpenter Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, prashanth.ka@pathpartnertech.com, praneeth@ti.com, mchehab@kernel.org, linux-media@vger.kernel.org, praveen.ap@pathpartnertech.com Subject: Re: [PATCH 03/30] v4l: vxd-dec: Create vxd_dec Mem Manager helper library Message-ID: <20210914034032.orctp5ov5oc33vag@sidraya-laptopU> References: <20210818141037.19990-1-sidraya.bj@pathpartnertech.com> <20210818141037.19990-4-sidraya.bj@pathpartnertech.com> <20210824133438.GO1931@kadam> MIME-Version: 1.0 In-Reply-To: <20210824133438.GO1931@kadam> User-Agent: NeoMutt/20171215 Content-Type: text/plain; charset="US-ASCII" Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 24, 2021 at 04:34:38PM +0300, Dan Carpenter wrote: > On Wed, Aug 18, 2021 at 07:40:10PM +0530, sidraya.bj@pathpartnertech.com wrote: > > +int img_mem_create_ctx(struct mem_ctx **new_ctx) > > +{ > > + struct mem_man *mem_man = &mem_man_data; > > + struct mem_ctx *ctx; > > + > > + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); > > + if (!ctx) > > + return -ENOMEM; > > + > > + ctx->buffers = kzalloc(sizeof(*ctx->buffers), GFP_KERNEL); > > + if (!ctx->buffers) > > + return -ENOMEM; > > Smatch would have caught that this needs a kfree(ctx); before returning. > > It wouldn't hurt to run Smatch over this code. > > git clone https://repo.or.cz/w/smatch.git > cd smatch > yum install gcc make sqlite3 sqlite-devel sqlite perl-DBD-SQLite openssl-devel perl-Try-Tiny > make > cd ~/kernel/ > ~/smatch/smatch_scripts/kchecker drivers/staging/media/vxd/common/img_mem_man.c > > (I am the author of Smatch #BlowYourOwnTrumpet). > > regards, > dan carpenter > I will run Smatch and will remove similar findings. Thank you for reviewing. -- This message contains confidential information and is intended only for the individual(s) named. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this mail and attached file/s is strictly prohibited. Please notify the sender immediately and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission.