All of lore.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2004-03-21  6:24 linguist
  2004-03-21 16:45 ` [PATCH] fix tiocgdev 32/64bit emul Jeff Garzik
  0 siblings, 1 reply; 9+ messages in thread
From: linguist @ 2004-03-21  6:24 UTC (permalink / raw)
  To: linux-kernel

This is just a random observation, I don't know this piece of code
or the kernel in general, but instinct tells me that where is says
"if (!fd) return -EBADF", it should say "if (!file) return -EBADF".
Just a heads up.

Regards,
Rich

static int tiocgdev(unsigned fd, unsigned cmd,  unsigned int *ptr) 
{ 

	struct file *file = fget(fd);
	struct tty_struct *real_tty;

	if (!fd)
		return -EBADF;
	if (file->f_op->ioctl != tty_ioctl)
		return -EINVAL; 
	real_tty = (struct tty_struct *)file->private_data;
	if (!real_tty) 	
		return -EINVAL; 
	return put_user(new_encode_dev(tty_devnum(real_tty)), ptr); 
} 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-03-21 20:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-21  6:24 linguist
2004-03-21 16:45 ` [PATCH] fix tiocgdev 32/64bit emul Jeff Garzik
2004-03-21 16:57   ` Christoph Hellwig
2004-03-21 18:50     ` Carl-Daniel Hailfinger
2004-03-21 18:55       ` Christoph Hellwig
2004-03-21 19:57         ` Carl-Daniel Hailfinger
2004-03-21 20:02           ` Christoph Hellwig
2004-03-21 20:17             ` Carl-Daniel Hailfinger
2004-03-21 20:26               ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.