From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EF72C433F5 for ; Tue, 14 Sep 2021 03:40:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82ABC610A2 for ; Tue, 14 Sep 2021 03:40:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239089AbhINDmC (ORCPT ); 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-Google-Smtp-Source: ABdhPJzvPREwsMVsSmlMxKvhTvyVINXu+p/ZqeLrzBiwtjk/uh+XdKf8sXnTS5Q0/U0ON8qIWM8GuA== 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.