VirtualBox

Changeset 66509 in vbox


Ignore:
Timestamp:
Apr 11, 2017 11:19:10 AM (8 years ago)
Author:
vboxsync
Message:

bugref:8524: Additions/linux: play nicely with distribution-installed Additions

additions/linux/drm: Remove unnecessary check from accel_init

accel_init gets called exactly once per instance, so there is no need
to check of vbva_info has already been allocated.

While at it also switch to kcalloc.

Signed-off-by: Hans de Goede <hdegoede@…>.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_main.c

    r65992 r66509  
    243243{
    244244    unsigned i;
     245
     246    vbox->vbva_info = kcalloc(vbox->num_crtcs, sizeof(*vbox->vbva_info),
     247                              GFP_KERNEL);
    245248    if (!vbox->vbva_info)
    246     {
    247         vbox->vbva_info = kzalloc(  sizeof(struct VBVABUFFERCONTEXT)
    248                                   * vbox->num_crtcs,
    249                                   GFP_KERNEL);
    250         if (!vbox->vbva_info)
    251             return -ENOMEM;
    252     }
     249        return -ENOMEM;
     250
    253251    /* Take a command buffer for each screen from the end of usable VRAM. */
    254252    vbox->available_vram_size -= vbox->num_crtcs * VBVA_MIN_BUFFER_SIZE;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette