From: Giedrius Statkevičius Date: Thu, 9 Apr 2015 23:42:29 +0000 (+0300) Subject: staging: dgnc: clean up allocation of ->channels[i] X-Git-Tag: omap-for-v4.3/legacy-v2-signed~121^2~914 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa52d96c3ea110acb77e51c856ec0b54606cc17e;p=pandora-kernel.git staging: dgnc: clean up allocation of ->channels[i] Check if kzalloc fails in dgnc_tty_init() and if it does then free all previously allocated ->channels[i] and set them to NULL. This makes the code less error/bug prone because instead of needing programmers attention to add checks everywhere we do that in one place. Also, remove a bogus comment and check in the same loop because ->channels[i] isn't allocated anywhere else. Finally, remove a unnecessary check if ->channels[i] is NULL in the next loop because it can't be. Signed-off-by: Giedrius Statkevičius Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed