From: Andi Shyti <andi.shyti@linux.intel.com>
To: ���α� <inki.dae@samsung.com>
Cc: 'Andi Shyti' <andi.shyti@linux.intel.com>,
dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org,
'Andi Shyti' <andi.shyti@kernel.org>
Subject: Re: [PATCH] drm/exynos: vidi: fix a wrong error return
Date: Fri, 19 May 2023 11:21:14 +0200 [thread overview]
Message-ID: <ZGc/ipQspaaUf5FX@ashyti-mobl2.lan> (raw)
In-Reply-To: <04c401d98a09$898df160$9ca9d420$@samsung.com>
Hi Inki,
> > > @@ -469,8 +469,6 @@ static int vidi_remove(struct platform_device *pdev)
> > > if (ctx->raw_edid != (struct edid *)fake_edid_info) {
> > > kfree(ctx->raw_edid);
> > > ctx->raw_edid = NULL;
> > > -
> > > - return -EINVAL;
> >
> > It doesn't look right to me, I think the correct patch should be:
> >
> > - if (ctx->raw_edid != (struct edid *)fake_edid_info) {
> > - kfree(ctx->raw_edid);
> > - ctx->raw_edid = NULL;
> > -
> > - return -EINVAL;
> > - }
> > -
> > + ctx->raw_edid = NULL;
> >
> > because "ctx->raw_edid" points to a non allocated memory in the
> > .data segment and you cannot free it.
> >
> > A follow-up cleanup should be to remove the "const" from
> > fake_edid_info because you are assigning its address to pointers
> > (raw_edid), so that what's the point for having it const? You are
> > just fooling the compiler :)
>
> Thanks for review comment.
>
> "ctx->raw_edid != fake_edid_info" means that the edid sent by the user through
> the ictl system call - vidi_connection_ioctl - is used instead of fake one -
> face_edid_info.
> In this case, ctx->raw_edid object needs to be released because ctx->raw_edid
> object is allocated and the edid object sent by user is copied to the ctx-
> >raw_edid by kmemdup(). :)
yes... yes... I sent you another e-mail after this :)
Thanks,
Andi
prev parent reply other threads:[~2023-05-19 9:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230519000408epcas1p4f5d90f588e7250d2d168d2943adef4f7@epcas1p4.samsung.com>
2023-05-19 0:04 ` [PATCH] drm/exynos: vidi: fix a wrong error return Inki Dae
2023-05-19 0:26 ` Andi Shyti
2023-05-19 2:37 ` Andi Shyti
2023-05-19 4:22 ` 대인기
2023-05-19 9:21 ` Andi Shyti [this message]
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=ZGc/ipQspaaUf5FX@ashyti-mobl2.lan \
--to=andi.shyti@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=linux-samsung-soc@vger.kernel.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