Re: try_module_get in hfi1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/3/2019 11:20 AM, Jason Gunthorpe wrote:
Intel Guys,

I'm looking at code in hfi1:

static int __i2c_debugfs_open(struct inode *in, struct file *fp, u32 target)
{
	struct hfi1_pportdata *ppd;
	int ret;

	if (!try_module_get(THIS_MODULE))
		return -ENODEV;

Seems like nonsense to me.

I think it should be:

--- a/drivers/infiniband/hw/hfi1/debugfs.c
+++ b/drivers/infiniband/hw/hfi1/debugfs.c
@@ -1155,6 +1155,7 @@ static int exprom_wp_debugfs_release(struct inode *in, struct file *fp)
  { \
         .name = nm, \
         .ops = { \
+               .owner = THIS_MODULE, \
                 .read = readroutine, \
                 .write = writeroutine, \
                 .llseek = generic_file_llseek, \
@@ -1165,6 +1166,7 @@ static int exprom_wp_debugfs_release(struct inode *in, struct file *fp)
  { \
         .name = nm, \
         .ops = { \
+               .owner = THIS_MODULE, \
                 .read = readf, \
                 .write = writef, \
                 .llseek = generic_file_llseek, \


Can you fix it??

Jason


Hmm. Yeah, let me take a look.

-Denny



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux