From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH 2/3] sm501fb: unregister framebuffer only if registered
Date: Sat, 4 Nov 2017 21:24:20 +0000 [thread overview]
Message-ID: <1509830661-7384-2-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1509830661-7384-1-git-send-email-sudipm.mukherjee@gmail.com>
There are cases when panel and crt both are not defined and only one of
them is defined and initialized. In such cases, while removing the
device, unregister the framebuffer only if it was registered.
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
drivers/video/fbdev/sm501fb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index 381475f..577a483 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -2079,8 +2079,10 @@ static int sm501fb_remove(struct platform_device *pdev)
sm501_free_init_fb(info, HEAD_CRT);
sm501_free_init_fb(info, HEAD_PANEL);
- unregister_framebuffer(fbinfo_crt);
- unregister_framebuffer(fbinfo_pnl);
+ if (fbinfo_crt)
+ unregister_framebuffer(fbinfo_crt);
+ if (fbinfo_pnl)
+ unregister_framebuffer(fbinfo_pnl);
sm501fb_stop(info);
kfree(info);
--
2.1.4
next prev parent reply other threads:[~2017-11-04 21:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171104212429epcas1p428cc1efb505e9c78dda41e603c400b7b@epcas1p4.samsung.com>
2017-11-04 21:24 ` [PATCH 1/3] sm501fb: deallocate colormap only if allocated Sudip Mukherjee
2017-11-04 21:24 ` Sudip Mukherjee [this message]
2017-11-09 15:10 ` [PATCH 2/3] sm501fb: unregister framebuffer only if registered Bartlomiej Zolnierkiewicz
2017-11-04 21:24 ` [PATCH 3/3] sm501fb: suspend and resume fb if it exists Sudip Mukherjee
2017-11-09 15:11 ` Bartlomiej Zolnierkiewicz
2017-11-09 15:10 ` [PATCH 1/3] sm501fb: deallocate colormap only if allocated Bartlomiej Zolnierkiewicz
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=1509830661-7384-2-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@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 NNTP newsgroup(s).