From: Douglas Schilling Landgraf Date: Sun, 27 Jan 2008 17:29:51 +0000 (-0300) Subject: V4L/DVB (7092): radio-sf16fmr2: fix request_region() validation [bugzilla 9699] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd49f30ca032464839085ec3a54dd9917829c891;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git V4L/DVB (7092): radio-sf16fmr2: fix request_region() validation [bugzilla 9699] This patch changed the request_region() validation to avoid invalid return. Thanks to Roland Kletzing for bug report and data collection. Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index f7c8b000404f..ebc5fbbc38bb 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -470,9 +470,8 @@ static int __init fmr2_init(void) mutex_init(&lock); - if (request_region(io, 2, "sf16fmr2")) - { - printk(KERN_ERR "fmr2: port 0x%x already in use\n", io); + if (!request_region(io, 2, "sf16fmr2")) { + printk(KERN_ERR "radio-sf16fmr2: request_region failed!\n"); return -EBUSY; }