From: Devendra Naga <develkernel412222@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Javier Muñoz" <jmunhoz@igalia.com>,
"Paul Gortmaker" <paul.gortmaker@windriver.com>,
"Devendra Naga" <devendra.aaru@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Devendra Naga <develkernel412222@gmail.com>
Subject: [PATCH] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info
Date: Sat, 4 Aug 2012 23:06:12 +0545 [thread overview]
Message-ID: <1344100872-19640-1-git-send-email-develkernel412222@gmail.com> (raw)
as we do a strcpy(smdrv_ptr->fb_struct->fix->id, name), and the name here in
sm7xxx_probe is not having any assignment, and which leads to copying of the garbage value
into the id field of the fix struct of fb interface struct. fix it by copying the name before
calling alloc_fbinfo
Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
Only compile tested
This patch is not tested using the hardware... if any one is having this hardware, i request them to
please test this
drivers/staging/sm7xxfb/sm7xxfb.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c
index 1c1780c..d3957ef 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -798,16 +798,17 @@ static int __devinit smtcfb_pci_probe(struct pci_dev *pdev,
if (err)
return err;
+ sprintf(name, "sm%Xfb", ent->device);
+
sfb = smtc_alloc_fb_info(pdev, name);
+ sfb->chip_id = ent->device;
+
if (!sfb) {
err = -ENOMEM;
goto failed_free;
}
- sfb->chip_id = ent->device;
- sprintf(name, "sm%Xfb", sfb->chip_id);
-
pci_set_drvdata(pdev, sfb);
sm7xx_init_hw();
--
1.7.9.5
next reply other threads:[~2012-08-04 17:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-04 17:21 Devendra Naga [this message]
2012-08-06 14:12 ` [PATCH] staging: sm7xxfb: copy name of the device before calling smtc_alloc_fb_info Dan Carpenter
2012-08-06 16:12 ` Devendra Naga
2012-08-06 18:17 ` Dan Carpenter
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=1344100872-19640-1-git-send-email-develkernel412222@gmail.com \
--to=develkernel412222@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=devendra.aaru@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jmunhoz@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
/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