From: Mauro Carvalho Chehab Date: Tue, 11 Aug 2015 15:18:33 +0000 (-0300) Subject: [media] sr030pc30: don't read a new pointer X-Git-Tag: omap-for-v4.3/fixes-rc1~26^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27c039750c8ff1297632e424a4674732cc4c3c70;p=pandora-kernel.git [media] sr030pc30: don't read a new pointer sr030pc30_get_fmt() can only succeed if both info->curr_win and info->curr_fmt are not NULL. If one of those vars are null, the curent code would call: ret = sr030pc30_set_params(sd); If the curr_win is null, it will return -EINVAL, as it would be expected. However, if curr_fmt is NULL, the function won't set it. The code will then try to read from it: mf->code = info->curr_fmt->code; mf->colorspace = info->curr_fmt->colorspace; with obviouly won't work. This got reported by smatch: drivers/media/i2c/sr030pc30.c:505 sr030pc30_get_fmt() error: we previously assumed 'info->curr_win' could be null (see line 499) drivers/media/i2c/sr030pc30.c:507 sr030pc30_get_fmt() error: we previously assumed 'info->curr_fmt' could be null (see line 499) Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed