Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe: Drop unnecessary goto in xe_device_create

The error label in this function just does an immediate return without
any further cleanup or processing. Replace the goto statements with
returns.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260204191025.3957211-2-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

+8 -12
+8 -12
drivers/gpu/drm/xe/xe_device.c
··· 456 456 xe->drm.anon_inode->i_mapping, 457 457 xe->drm.vma_offset_manager, 0); 458 458 if (WARN_ON(err)) 459 - goto err; 459 + return ERR_PTR(err); 460 460 461 461 xe_bo_dev_init(&xe->bo_device); 462 462 err = drmm_add_action_or_reset(&xe->drm, xe_device_destroy, NULL); 463 463 if (err) 464 - goto err; 464 + return ERR_PTR(err); 465 465 466 466 err = xe_shrinker_create(xe); 467 467 if (err) 468 - goto err; 468 + return ERR_PTR(err); 469 469 470 470 xe->info.devid = pdev->device; 471 471 xe->info.revid = pdev->revision; ··· 475 475 476 476 err = xe_irq_init(xe); 477 477 if (err) 478 - goto err; 478 + return ERR_PTR(err); 479 479 480 480 xe_validation_device_init(&xe->val); 481 481 ··· 485 485 486 486 err = xe_pagemap_shrinker_create(xe); 487 487 if (err) 488 - goto err; 488 + return ERR_PTR(err); 489 489 490 490 xa_init_flags(&xe->usm.asid_to_vm, XA_FLAGS_ALLOC); 491 491 ··· 504 504 505 505 err = xe_bo_pinned_init(xe); 506 506 if (err) 507 - goto err; 507 + return ERR_PTR(err); 508 508 509 509 xe->preempt_fence_wq = alloc_ordered_workqueue("xe-preempt-fence-wq", 510 510 WQ_MEM_RECLAIM); ··· 518 518 * drmm_add_action_or_reset register above 519 519 */ 520 520 drm_err(&xe->drm, "Failed to allocate xe workqueues\n"); 521 - err = -ENOMEM; 522 - goto err; 521 + return ERR_PTR(-ENOMEM); 523 522 } 524 523 525 524 err = drmm_mutex_init(&xe->drm, &xe->pmt.lock); 526 525 if (err) 527 - goto err; 526 + return ERR_PTR(err); 528 527 529 528 return xe; 530 - 531 - err: 532 - return ERR_PTR(err); 533 529 } 534 530 ALLOW_ERROR_INJECTION(xe_device_create, ERRNO); /* See xe_pci_probe() */ 535 531