]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gma500: clean up error handling in init
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 Dec 2020 08:40:48 +0000 (11:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Mar 2021 17:22:41 +0000 (18:22 +0100)
commit46586a2be1258b513a0748a55ffafa7090107476
tree71825600fb88939015319563e898947b5cf70ae3
parentc277783f3b2d039c440fc8ed73880346d5a2a1b9
gma500: clean up error handling in init

[ Upstream commit 15ccc39b3aab667c6fa131206f01f31bfbccdf6a ]

The main problem with this error handling was that it didn't clean up if
i2c_add_numbered_adapter() failed.  This code is pretty old, and doesn't
match with today's checkpatch.pl standards so I took the opportunity to
tidy it up a bit.  I changed the NULL comparison, and removed the
WARNING message if kzalloc() fails and updated the label names.

Fixes: 1b082ccf5901 ("gma500: Add Oaktrail support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/X8ikkAqZfnDO2lu6@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c