Skip to content

Commit

Permalink
isdn/capi: correct capi20_manufacturer argument type mismatch
Browse files Browse the repository at this point in the history
Function capi20_manufacturer() is declared with unsigned int cmd
argument but called with unsigned long.
Fix by correcting the function prototype since the actual argument
is part of the user visible API.

Spotted with Coverity.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tilman Schmidt authored and David S. Miller committed Oct 14, 2014
1 parent b8324f9 commit 9ea8aa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/isdn/capi/kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
* Return value: CAPI result code
*/

int capi20_manufacturer(unsigned int cmd, void __user *data)
int capi20_manufacturer(unsigned long cmd, void __user *data)
{
struct capi_ctr *ctr;
int retval;
Expand Down Expand Up @@ -1259,7 +1259,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
}

default:
printk(KERN_ERR "kcapi: manufacturer command %d unknown.\n",
printk(KERN_ERR "kcapi: manufacturer command %lu unknown.\n",
cmd);
break;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/kernelcapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
u16 capi20_get_version(u32 contr, struct capi_version *verp);
u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
int capi20_manufacturer(unsigned int cmd, void __user *data);
int capi20_manufacturer(unsigned long cmd, void __user *data);

#define CAPICTR_UP 0
#define CAPICTR_DOWN 1
Expand Down

0 comments on commit 9ea8aa8

Please sign in to comment.