linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
To: broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: devm_spi_register_master
Date: Mon, 11 Nov 2013 09:44:56 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.02.1311110935230.2300@hadrien> (raw)

Hello,

I was looking into the use of devm_spi_register_master.  This function
seems to take care of registering and unregistering, but not allocation
and freeing.  I have the impression that that is done with
spi_alloc_master and and spi_master_put, which are not managed functions.
But then I wonder how this can work?  It seems that the spi_master_put
function should remain in the probe or remove function, and then the
object could be freed before it is unregistered?

The patch 2fe7e4add3e53df7c1b97e32076f8390dd81c6b3 introduces a call to
devm_spi_register_master and also removes a call to spi_master_put.  By my
reasoning, this would cause a memory leak.

Am I missing something?

thanks,
julia
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2013-11-11 17:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 17:44 Julia Lawall [this message]
2013-11-12  0:06 ` devm_spi_register_master Jingoo Han
     [not found]   ` <002701cedf3b$19f5b280$4de11780$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-12  3:18     ` devm_spi_register_master Julia Lawall
2013-11-12  6:48       ` devm_spi_register_master Jingoo Han
     [not found]         ` <000301cedf73$2ae7a3e0$80b6eba0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-22  2:13           ` devm_spi_register_master Jingoo Han
2013-11-15  8:24       ` devm_spi_register_master Jingoo Han
     [not found]         ` <000e01cee1dc$12a4fba0$37eef2e0$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-11-15  8:49           ` devm_spi_register_master Wei Yongjun
     [not found]             ` <CAPgLHd9hFNuke_cfs9QrQ0E0E_QmRfN3=fESUtBH6PPGgx=Wbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-11-16 16:05               ` devm_spi_register_master Julia Lawall
2013-11-16 10:50 ` devm_spi_register_master Mark Brown
     [not found]   ` <20131116105029.GN15393-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-11-16 15:24     ` devm_spi_register_master Julia Lawall
2013-11-16 15:45       ` devm_spi_register_master Mark Brown

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=alpine.DEB.2.02.1311110935230.2300@hadrien \
    --to=julia.lawall-l2ftfq7bk8m@public.gmane.org \
    --cc=broonie-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).