media: r820t: don't crash if attach fails
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Mar 2018 13:18:36 +0000 (09:18 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 4 Apr 2018 09:36:20 +0000 (05:36 -0400)
commit2e81ae396788c7f1af327510899f06f773fe3501
tree45bda80a6731db5c387083b2443ec8c8b9c2ffbd
parent17dec0a949153d9ac00760ba2f5b78cb583e995f
media: r820t: don't crash if attach fails

As pointed by smatch:
drivers/media/tuners/r820t.c:2374 r820t_attach() error: potential null dereference 'priv'.  (kzalloc returns null)

The current function with prints error assumes that the attach
succeeds. So, don't use it in case of failures.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/tuners/r820t.c