lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Apr 2014 20:02:14 +0900
From:	DaeSeok Youn <daeseok.youn@...il.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Mark Hounschell <markh@...pro.net>,
	Lidza Louina <lidza.louina@...il.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	devel <devel@...verdev.osuosl.org>,
	driverdev-devel@...uxdriverproject.org,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: dgap: implement error handling in dgap_tty_register()

Hi, Dan.

2014-04-25 18:26 GMT+09:00 Dan Carpenter <dan.carpenter@...cle.com>:
> Mark, maybe you should add yourself to the MAINTAINERS entry for this
> driver?
>
> On Fri, Apr 25, 2014 at 04:04:59PM +0900, Daeseok Youn wrote:
>> @@ -1263,7 +1277,8 @@ static int dgap_tty_register(struct board_t *brd)
>>               /* Register tty devices */
>>               rc = tty_register_driver(brd->SerialDriver);
>>               if (rc < 0)
>> -                     return rc;
>> +                     goto free_print_ttys;
>> +
>>               brd->dgap_Major_Serial_Registered = TRUE;
>>               dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
>>               brd->dgap_Serial_Major = brd->SerialDriver->major;
>> @@ -1273,13 +1288,29 @@ static int dgap_tty_register(struct board_t *brd)
>>               /* Register Transparent Print devices */
>>               rc = tty_register_driver(brd->PrintDriver);
>>               if (rc < 0)
>> -                     return rc;
>> +                     goto unregister_serial_drv;
>> +
>>               brd->dgap_Major_TransparentPrint_Registered = TRUE;
>>               dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
>>               brd->dgap_TransparentPrint_Major = brd->PrintDriver->major;
>>       }
>>
>>       return rc;
>> +
>> +unregister_serial_drv:
>> +     tty_unregister_driver(brd->SerialDriver);
>
> We only register the ->SerialDriver if someone else hasn't registered it
> first?  So this should be:
>
>         if (we_were_the_ones_who_registered_the_serial_driver)
>                 tty_unregister_driver(brd->SerialDriver);
>
> I haven't followed looked at this.  Who else is registering the serial
> driver?  You have looked at this, what do you think?  Or Mark.

I think brd struct is from dgap_Board array as global static variable
when this function is
called. So brd->dgap_Major_Serial_Registered is always "false".
If dgap_NumBoards is less than MAXBOARDS, brd->SerialDriver should be
registered.

I'm not sure..

Thanks.

Regards,
Daeseok Youn.

>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ