From: Helge Deller <deller@gmx.de>
To: Cai Xinchen <caixinchen1@huawei.com>,
adaplas@gmail.com, fullwaywang@outlook.com
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH -next] fbdev: savage: Handle err return when savagefb_check_var failed
Date: Thu, 25 Apr 2024 12:05:20 +0200 [thread overview]
Message-ID: <1a3d30bc-130c-49ce-93ed-d380d5159dfa@gmx.de> (raw)
In-Reply-To: <20240416065137.530693-1-caixinchen1@huawei.com>
On 4/16/24 08:51, Cai Xinchen wrote:
> The commit 04e5eac8f3ab("fbdev: savage: Error out if pixclock equals zero")
> checks the value of pixclock to avoid divide-by-zero error. However
> the function savagefb_probe doesn't handle the error return of
> savagefb_check_var. When pixclock is 0, it will cause divide-by-zero error.
>
> Fixes: 04e5eac8f3ab ("fbdev: savage: Error out if pixclock equals zero")
> Signed-off-by: Cai Xinchen <caixinchen1@huawei.com>
> Cc: stable@vger.kernel.org
> ---
> drivers/video/fbdev/savage/savagefb_driver.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
applied.
Thanks!
Helge
>
> diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c
> index ebc9aeffdde7..ac41f8f37589 100644
> --- a/drivers/video/fbdev/savage/savagefb_driver.c
> +++ b/drivers/video/fbdev/savage/savagefb_driver.c
> @@ -2276,7 +2276,10 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
> if (info->var.xres_virtual > 0x1000)
> info->var.xres_virtual = 0x1000;
> #endif
> - savagefb_check_var(&info->var, info);
> + err = savagefb_check_var(&info->var, info);
> + if (err)
> + goto failed;
> +
> savagefb_set_fix(info);
>
> /*
prev parent reply other threads:[~2024-04-25 10:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 6:51 [PATCH -next] fbdev: savage: Handle err return when savagefb_check_var failed Cai Xinchen
2024-04-25 10:05 ` 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=1a3d30bc-130c-49ce-93ed-d380d5159dfa@gmx.de \
--to=deller@gmx.de \
--cc=adaplas@gmail.com \
--cc=caixinchen1@huawei.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=fullwaywang@outlook.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).