Bug 43009

Summary: mct_u232 usb serial driver return code wrong on ioctl( , TIOCMSET, )
Product: Drivers Reporter: Erik Thiele (erik.thiele)
Component: SerialAssignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, florian
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.2.0-1-rt-686-pae #1 SMP PREEMPT RT Subsystem:
Regression: No Bisected commit-id:

Description Erik Thiele 2012-03-29 11:01:02 UTC
the documentation on
http://linux.die.net/man/4/tty_ioctl
sais:
Return Value

The ioctl(2) system call returns 0 on success. On error it returns -1
and sets errno appropriately.


opposing to this i straced the following on the mct_u232 driver:

ioctl(5, TIOCMGET, [TIOCM_DTR|TIOCM_RTS]) = 0
ioctl(5, TIOCMSET, [TIOCM_DTR|TIOCM_RTS]) = 1

the returncode of 1 is illegal. i checked for errno value and it is 0
then. please return 0 or set errno accordingly.
Comment 1 Alan 2012-06-18 10:33:49 UTC
Fix queued
Comment 2 Florian Mickler 2012-07-01 09:49:47 UTC
A patch referencing this bug report has been merged in Linux v3.5-rc3:

commit 1aa3c63cf0a79153ee13c8f82e4eb6c40b66a161
Author: Alan Cox <alan@linux.intel.com>
Date:   Tue May 22 20:45:13 2012 +0100

    USB: mct_u232: Fix incorrect TIOCMSET return