lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACvgo51JCYHrUTmyfiRSWXw5px=-zePzdOM41aMGfVLXATXbHA@mail.gmail.com>
Date:	Thu, 2 Apr 2015 23:29:53 +0100
From:	Emil Velikov <emil.l.velikov@...il.com>
To:	Jilai Wang <jilaiw@...eaurora.org>
Cc:	ML dri-devel <dri-devel@...ts.freedesktop.org>,
	linux-arm-msm <linux-arm-msm@...r.kernel.org>,
	"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] drm:msm: Initial Add Writeback Support

On 2 April 2015 at 19:07,  <jilaiw@...eaurora.org> wrote:
> Thanks Emil. Please check the comments embedded and for the rest I will
> update the code.
>
>> Hi Jilai,
>>
>> Just a few questions, not really a review as I'm not that familiar
>> with the code.
>>
>>
>>> +++ b/drivers/gpu/drm/msm/Kconfig
>>> @@ -27,6 +27,16 @@ config DRM_MSM_FBDEV
>>>           support. Note that this support also provide the linux console
>>>           support on top of the MSM modesetting driver.
>>>
>>> +config DRM_MSM_WB
>>> +       bool "Enable writeback support for MSM modesetting driver"
>>> +       depends on DRM_MSM
>>> +       depends on VIDEO_V4L2
>>> +       select VIDEOBUF2_CORE
>>> +       default y
>>> +       help
>>> +         Choose this option if you have a need to support writeback
>>> +         connector.
>>> +
>> Is it worth mentioning which devices/SoCs have such connector ?
> If the devices have WB connector, it will be added in the device tree.
>
I was thinking more about listing a one or two SoCs so that one gets
the general idea. Although it might end up more confusing than helpful
as more devices become available. Suggestion withdrawn.


>>> +static struct msm_wb *msm_wb_init(struct platform_device *pdev)
>>> +{
>>> +       struct msm_wb *wb = NULL;
>>> +
>>> +       wb = devm_kzalloc(&pdev->dev, sizeof(*wb), GFP_KERNEL);
>>> +       if (!wb)
>>> +               return ERR_PTR(-ENOMEM);
>>> +
>>> +       wb->pdev = pdev;
>>> +       wb->priv_data = devm_kzalloc(&pdev->dev, sizeof(*wb->priv_data),
>>> +               GFP_KERNEL);
>>> +       if (!wb->priv_data)
>>> +               return ERR_PTR(-ENOMEM);
>>> +
>>> +       if (msm_wb_v4l2_init(wb)) {
>>> +               pr_err("%s: wb v4l2 init failed\n", __func__);
>>> +               return ERR_PTR(-ENODEV);
>>> +       }
>>> +
>> Seems like we're leaking wb and/or wb->priv_data. Add a label and
>> consolidate error handling in there ?
>
> Since the devm_kzalloc function is used here, the system should take care
> freeing the memory.
You're spot on. Somehow I did not notice that we're using the devm_
version of kzalloc.
/me runs in shame :-)

Cheers,
Emil
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ