public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Haowen Bai <baihaowen@meizu.com>,
	Thomas Winischhofer <thomas@winischhofer.net>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300()
Date: Fri, 1 Apr 2022 22:53:02 +0200	[thread overview]
Message-ID: <f6802e83-0fc6-ffe6-cea1-d2a39d768514@gmx.de> (raw)
In-Reply-To: <1648784476-20803-1-git-send-email-baihaowen@meizu.com>

On 4/1/22 05:41, Haowen Bai wrote:
> bios could be null without checking null and return in this function,
> but still dereference bios[0xf5].
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>

applied.
Thanks!
Helge

> ---
>  drivers/video/fbdev/sis/sis_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
> index 742f629..24a0299 100644
> --- a/drivers/video/fbdev/sis/sis_main.c
> +++ b/drivers/video/fbdev/sis/sis_main.c
> @@ -4463,7 +4463,7 @@ static void sisfb_post_sis300(struct pci_dev *pdev)
>  		SiS_SetReg(SISCR, 0x37, 0x02);
>  		SiS_SetReg(SISPART2, 0x00, 0x1c);
>  		v4 = 0x00; v5 = 0x00; v6 = 0x10;
> -		if(ivideo->SiS_Pr.UseROM) {
> +		if (ivideo->SiS_Pr.UseROM && bios) {
>  			v4 = bios[0xf5];
>  			v5 = bios[0xf6];
>  			v6 = bios[0xf7];


      reply	other threads:[~2022-04-01 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  3:41 [PATCH] video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300() Haowen Bai
2022-04-01 20:53 ` Helge Deller [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=f6802e83-0fc6-ffe6-cea1-d2a39d768514@gmx.de \
    --to=deller@gmx.de \
    --cc=baihaowen@meizu.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@winischhofer.net \
    /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