/* TTY callbacks */
static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
- __u8 *buf, size_t nr);
+ __u8 __user *buf, size_t nr);
static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
- const __u8 *buf, size_t nr);
+ const __u8 __user *buf, size_t nr);
static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg);
static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
#endif
tty->disc_data = NULL;
if (tty == n_hdlc->backup_tty)
- n_hdlc->backup_tty = 0;
+ n_hdlc->backup_tty = NULL;
if (tty != n_hdlc->tty)
return;
if (n_hdlc->backup_tty) {
* Returns the number of bytes returned or error code.
*/
static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
- __u8 *buf, size_t nr)
+ __u8 __user *buf, size_t nr)
{
struct n_hdlc *n_hdlc = tty2n_hdlc(tty);
int error;
* Returns the number of bytes written (or error code).
*/
static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
- const __u8 *data, size_t count)
+ const __u8 __user *data, size_t count)
{
struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
int error = 0;
else
count = 0;
spin_unlock_irqrestore(&n_hdlc->rx_buf_list.spinlock,flags);
- error = put_user(count, (int *)arg);
+ error = put_user(count, (int __user *)arg);
break;
case TIOCOUTQ:
if (n_hdlc->tx_buf_list.head)
count += n_hdlc->tx_buf_list.head->count;
spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock,flags);
- error = put_user(count, (int*)arg);
+ error = put_user(count, (int __user *)arg);
break;
default:
struct n_hdlc *n_hdlc = kmalloc(sizeof(*n_hdlc), GFP_KERNEL);
if (!n_hdlc)
- return 0;
+ return NULL;
memset(n_hdlc, 0, sizeof(*n_hdlc));