diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-01-22 18:41:04 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-01-22 18:48:19 +0100 |
commit | 139f77a7efd40d2eb2a4a8b2d8041b80dd3965b8 (patch) | |
tree | 125e88e64aa6f6ab96cbcbad0a206c081c6458b5 /drivers/video | |
parent | 1d3625dd9903bcc59e2df56836565ebb682948c1 (diff) |
Check null pointers for sysfs calls
When grepping through sysfs, grep tries to read all sysfs files
which are available. Some of them lead to error due to null pointers.
Therefor check for null pointers before using them.
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/fb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 70b82bde9e43..b687382d1dd4 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -399,6 +399,9 @@ static int tegra_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long } int tegra_fb_get_mode(struct tegra_dc *dc) { + /* Avoid error when reading sysfs */ + if (dc->fb->info->mode == NULL) + return 0; return dc->fb->info->mode->refresh; } |