[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOGAQepYWjm1TzLaRXnhFksDuQR-ukeChfHFRj1=uWyaUe-i+w@mail.gmail.com>
Date: Tue, 16 Oct 2018 13:48:16 -0700
From: Roman Kiryanov <rkir@...gle.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, Todd Kjos <tkjos@...gle.com>
Subject: Re: [PATCH v3 06/15] platform: goldfish: pipe: Move memory allocation
from probe to init
> I think we are getting our terms confused here.
>
> "init" usually means module_init(), is that what you are referring to
> here?
This is just a function that probe calls to, goldfish_pipe_device_v2_init.
https://android.googlesource.com/kernel/goldfish/+/android-goldfish-4.14-dev/drivers/platform/goldfish/goldfish_pipe_v2.c#1128
> Why would your probe function know, or care, about versions?
Different driver versions allocate different state.
> How is your probe function learning about the "version" to use here?
writel(PIPE_DRIVER_VERSION, base + PIPE_V2_REG_VERSION);
version = readl(base + PIPE_V2_REG_VERSION);
https://android.googlesource.com/kernel/goldfish/+/android-goldfish-4.14-dev/drivers/platform/goldfish/goldfish_pipe.c#106
> You have to clean up after your probe function failing before you return
> from it.
Are you saying that devm_kzalloc does not free memory if probe fails?
Is this useful?
I can free memory myself then.
Powered by blists - more mailing lists