From: Ben Skeggs Date: Thu, 22 Sep 2011 02:51:31 +0000 (+1000) Subject: drm/nouveau: fix oops if i2c bus not found in nouveau_i2c_identify() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=46b348865011bf0d706fe1ec8c9cef08cf86ad40;p=linux-beck.git drm/nouveau: fix oops if i2c bus not found in nouveau_i2c_identify() Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index c6143df48b9f..d39b2202b197 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c @@ -333,7 +333,7 @@ nouveau_i2c_identify(struct drm_device *dev, const char *what, NV_DEBUG(dev, "Probing %ss on I2C bus: %d\n", what, index); - for (i = 0; info[i].addr; i++) { + for (i = 0; i2c && info[i].addr; i++) { if (nouveau_probe_i2c_addr(i2c, info[i].addr) && (!match || match(i2c, &info[i]))) { NV_INFO(dev, "Detected %s: %s\n", what, info[i].type);