[linux-dvb] [PATCH] fix bug in front-end ioctl (again)

Trent Piepho xyzzy at speakeasy.org
Sat Jun 10 22:38:51 CEST 2006


Sent this about three weeks ago, but it looks like it never made it in.
It's a fairly obvious bug fix.

---------- Forwarded message ----------
Date: Fri, 26 May 2006 10:48:52 -0700 (PDT)
From: Trent Piepho <xyzzy at speakeasy.org>
To: Linux DVB Mailing List <linux-dvb at linuxtv.org>
Subject: [PATCH] fix bug in front-end ioctl

When someone added the front-end ioctl FE_SET_FRONTEND_TUNE_MODE, they
forgot to set the return value to 0.  It always returns EOPNOTSUPP,
causing problems for programmers who actually check for error conditions.

It's amazing that a bug like this could go so long unnoticed.  Am I
the only programmer who bothers to check if their ioctls() fail?
-------------- next part --------------
# HG changeset patch
# User Trent Piepho <xyzzy at speakeasy.org>
# Node ID 64ab788fda07e1acf274833fddd406306d7639cc
# Parent  c009e4653f31ce6c27d0712a50a69a998aec245b
The FE_SET_FRONTEND_TUNE_MODE ioctl always returns EOPNOTSUPP

From: Trent Piepho <xyzzy at speakeasy.org>

When someone added the front-end ioctl FE_SET_FRONTEND_TUNE_MODE, they
forgot to set the return value to 0.  It always returns EOPNOTSUPP,
causing problems for programmers who actually check for error conditions.

Signed-off-by: Trent Piepho <xyzzy at speakeasy.org>

diff -r c009e4653f31 -r 64ab788fda07 linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	Wed May 24 10:35:18 2006 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	Fri May 26 10:37:39 2006 -0700
@@ -976,6 +976,7 @@ static int dvb_frontend_ioctl(struct ino
 
 	case FE_SET_FRONTEND_TUNE_MODE:
 		fepriv->tune_mode_flags = (unsigned long) parg;
+		err = 0;
 		break;
 	};
 


More information about the linux-dvb mailing list