<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2023년 5월 19일 (금) 오후 6:21, Andi Shyti <<a href="mailto:andi.shyti@linux.intel.com">andi.shyti@linux.intel.com</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Inki,<br>
<br>
> > > @@ -469,8 +469,6 @@ static int vidi_remove(struct platform_device *pdev)<br>
> > >   if (ctx->raw_edid != (struct edid *)fake_edid_info) {<br>
> > >           kfree(ctx->raw_edid);<br>
> > >           ctx->raw_edid = NULL;<br>
> > > -<br>
> > > -         return -EINVAL;<br>
> > <br>
> > It doesn't look right to me, I think the correct patch should be:<br>
> > <br>
> > -       if (ctx->raw_edid != (struct edid *)fake_edid_info) {<br>
> > -               kfree(ctx->raw_edid);<br>
> > -               ctx->raw_edid = NULL;<br>
> > -<br>
> > -               return -EINVAL;<br>
> > -       }<br>
> > -<br>
> > +       ctx->raw_edid = NULL;<br>
> > <br>
> > because "ctx->raw_edid" points to a non allocated memory in the<br>
> > .data segment and you cannot free it.<br>
> > <br>
> > A follow-up cleanup should be to remove the "const" from<br>
> > fake_edid_info because you are assigning its address to pointers<br>
> > (raw_edid), so that what's the point for having it const? You are<br>
> > just fooling the compiler :)<br>
> <br>
> Thanks for review comment. <br>
> <br>
> "ctx->raw_edid != fake_edid_info" means that the edid sent by the user through<br>
> the ictl system call - vidi_connection_ioctl - is used instead of fake one -<br>
> face_edid_info.<br>
> In this case, ctx->raw_edid object needs to be released because ctx->raw_edid<br>
> object is allocated and the edid object sent by user is copied to the ctx-<br>
> >raw_edid by kmemdup(). :)<br>
<br>
yes... yes... I sent you another e-mail after this :)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I didn't check the second email you sent. :)</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Inki Dae</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Andi<br>
</blockquote></div></div></div>