All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Anton Vasilyev <vasilyev@ispras.ru>
Cc: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Even Xu <even.xu@intel.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
Subject: Re: HID: intel_ish-hid: tx_buf memory leak on probe/remove
Date: Mon, 23 Jul 2018 14:55:41 -0700	[thread overview]
Message-ID: <fbac7919db6874c76ef3ac628c8356968bb55d7a.camel@linux.intel.com> (raw)
In-Reply-To: <a0faf8a7-17ea-0ed3-5bb5-f1e8fb5debf6@ispras.ru>

On Mon, 2018-07-23 at 20:56 +0300, Anton Vasilyev wrote:
> ish_dev_init() allocates 512*176 bytes memory for tx_buf and stores
> it at
> &dev->wr_free_list_head.link list on ish_probe().
> But there is no deallocation of this memory in ish_remove() and in 
> ish_probe()
> error path.
> So current intel-ish-ipc provides 88 KB memory leak for each
> probe/release.
> 
> I have two ideas 1) to replace kzalloc allocation by devm_kzalloc,
Thanks for finding this. We can replace both alloc in this function
with devm_ calls. Once you have a patch I can test.

Thanks,
Srinivas 

> or 2) release memory stored at &dev->wr_free_list_head.link list
> (and 
> may be at
> &dev->wr_processing_list_head.link) in all driver exits.
> 
> But I do not know which way is preferable for this case.
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> --
> Anton Vasilyev
> Linux Verification Center, ISPRAS
> web: http://linuxtesting.org
> e-mail: vasilyev@ispras.ru

  reply	other threads:[~2018-07-23 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 17:56 HID: intel_ish-hid: tx_buf memory leak on probe/remove Anton Vasilyev
2018-07-23 21:55 ` Srinivas Pandruvada [this message]
2018-07-24 14:34   ` [PATCH] " Anton Vasilyev
2018-07-30  1:36     ` Srinivas Pandruvada
2018-08-01 11:26       ` [PATCH v2] " Anton Vasilyev
2018-08-02 11:28         ` Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbac7919db6874c76ef3ac628c8356968bb55d7a.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=even.xu@intel.com \
    --cc=jikos@kernel.org \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vasilyev@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.