# \[PATCH 9/9\] fbdev: Coverity Bug 90

- From: Antonino A. Daplas \<adaplas@gmail.com\>
- Date: 2006-05-04 12:38:21 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2006/05/13456185
- Thread: https://ratatoskr.run/linux-fbdev/2006/05/13456185/t.md

```text
It's a false positive, but let's suppress it anyway.

Signed-off-by: Antonino Daplas <redacted>
---

 drivers/video/modedb.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 1aa36d3..7e539b6 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -791,8 +791,9 @@ struct fb_videomode *fb_find_best_mode(s
 			if (diff > d) {
 				diff = d;
 				best = mode;
-			} else if (diff == d && mode->refresh > best->refresh)
-			    best = mode;
+			} else if (diff == d && best &&
+				   mode->refresh > best->refresh)
+				best = mode;
 		}
 	}
 	return best;



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
```
