From: Dan Carpenter Date: Tue, 27 Apr 2010 21:11:05 +0000 (-0700) Subject: drivers/gpu/drm/drm_sysfs.c: sysfs files error handling X-Git-Tag: v2.6.34-rc7~24^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c4560d4d8909cc4feb6f9e875d0b92083e05cf;p=pandora-kernel.git drivers/gpu/drm/drm_sysfs.c: sysfs files error handling In the original code we used "j" as an iterator but we used "i" as an index. - for (j = 0; j < i; j++) - device_remove_file(&connector->kdev, - &connector_attrs[i]); Smatch complained about that because "i" was potentially passed the end of the array. Which makes sense if we should be using "j" there. I also thought that we should remove the files for &connector_attrs_opt1 but to do that I had to add separate iterators for &connector_attrs and &connector_attrs_opt1. Signed-off-by: Dan Carpenter Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Dave Airlie --- Reading git-diff-tree failed