[haiku-commits] Re: haiku: hrev46725 - in src/add-ons/kernel/drivers/graphics: radeon_hd intel_extreme

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 21 Jan 2014 10:07:31 +0100 (CET)

> On January 21, 2014 at 3:46 AM kallisti5@xxxxxxxxxxx wrote:
>       mutex_lock(&gLock);
> 
> -     if (info->open_count == 0) {
> +     if (info->open_count++ == 0) {
>               // this device has been opened for the first time, so
>               // we allocate needed resources and initialize the structure
>               info->init_status = radeon_hd_init(*info);
>               if (info->init_status == B_OK) {
> -                     info->open_count++;

This is wrong, too, though: if the initialization fails, the open count is never
decreased anymore, as close() is only called when open() succeeds.

Bye,
   Axel.

Other related posts: