@@ -280,13 +280,12 @@ acpi_evaluate_object(acpi_handle handle,
280
280
info -> parameters [info -> param_count ] = NULL ;
281
281
}
282
282
283
- #if 0
283
+ #ifdef _FUTURE_FEATURE
284
284
285
285
/*
286
286
* Begin incoming argument count analysis. Check for too few args
287
287
* and too many args.
288
288
*/
289
-
290
289
switch (acpi_ns_get_type (info -> node )) {
291
290
case ACPI_TYPE_METHOD :
292
291
@@ -370,68 +369,68 @@ acpi_evaluate_object(acpi_handle handle,
370
369
* If we are expecting a return value, and all went well above,
371
370
* copy the return value to an external object.
372
371
*/
373
- if (return_buffer ) {
374
- if (!info -> return_object ) {
375
- return_buffer -> length = 0 ;
376
- } else {
377
- if (ACPI_GET_DESCRIPTOR_TYPE (info -> return_object ) ==
378
- ACPI_DESC_TYPE_NAMED ) {
379
- /*
380
- * If we received a NS Node as a return object, this means that
381
- * the object we are evaluating has nothing interesting to
382
- * return (such as a mutex, etc.) We return an error because
383
- * these types are essentially unsupported by this interface.
384
- * We don't check up front because this makes it easier to add
385
- * support for various types at a later date if necessary.
386
- */
387
- status = AE_TYPE ;
388
- info -> return_object = NULL ; /* No need to delete a NS Node */
389
- return_buffer -> length = 0 ;
390
- }
372
+ if (!return_buffer ) {
373
+ goto cleanup_return_object ;
374
+ }
391
375
392
- if (ACPI_SUCCESS (status )) {
376
+ if (!info -> return_object ) {
377
+ return_buffer -> length = 0 ;
378
+ goto cleanup ;
379
+ }
393
380
394
- /* Dereference Index and ref_of references */
381
+ if (ACPI_GET_DESCRIPTOR_TYPE (info -> return_object ) ==
382
+ ACPI_DESC_TYPE_NAMED ) {
383
+ /*
384
+ * If we received a NS Node as a return object, this means that
385
+ * the object we are evaluating has nothing interesting to
386
+ * return (such as a mutex, etc.) We return an error because
387
+ * these types are essentially unsupported by this interface.
388
+ * We don't check up front because this makes it easier to add
389
+ * support for various types at a later date if necessary.
390
+ */
391
+ status = AE_TYPE ;
392
+ info -> return_object = NULL ; /* No need to delete a NS Node */
393
+ return_buffer -> length = 0 ;
394
+ }
395
395
396
- acpi_ns_resolve_references (info );
396
+ if (ACPI_FAILURE (status )) {
397
+ goto cleanup_return_object ;
398
+ }
397
399
398
- /* Get the size of the returned object */
400
+ /* Dereference Index and ref_of references */
399
401
400
- status =
401
- acpi_ut_get_object_size (info -> return_object ,
402
- & buffer_space_needed );
403
- if (ACPI_SUCCESS (status )) {
404
-
405
- /* Validate/Allocate/Clear caller buffer */
406
-
407
- status =
408
- acpi_ut_initialize_buffer
409
- (return_buffer ,
410
- buffer_space_needed );
411
- if (ACPI_FAILURE (status )) {
412
- /*
413
- * Caller's buffer is too small or a new one can't
414
- * be allocated
415
- */
416
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,
417
- "Needed buffer size %X, %s\n" ,
418
- (u32 )
419
- buffer_space_needed ,
420
- acpi_format_exception
421
- (status )));
422
- } else {
423
- /* We have enough space for the object, build it */
424
-
425
- status =
426
- acpi_ut_copy_iobject_to_eobject
427
- (info -> return_object ,
428
- return_buffer );
429
- }
430
- }
431
- }
402
+ acpi_ns_resolve_references (info );
403
+
404
+ /* Get the size of the returned object */
405
+
406
+ status = acpi_ut_get_object_size (info -> return_object ,
407
+ & buffer_space_needed );
408
+ if (ACPI_SUCCESS (status )) {
409
+
410
+ /* Validate/Allocate/Clear caller buffer */
411
+
412
+ status = acpi_ut_initialize_buffer (return_buffer ,
413
+ buffer_space_needed );
414
+ if (ACPI_FAILURE (status )) {
415
+ /*
416
+ * Caller's buffer is too small or a new one can't
417
+ * be allocated
418
+ */
419
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO ,
420
+ "Needed buffer size %X, %s\n" ,
421
+ (u32 )buffer_space_needed ,
422
+ acpi_format_exception (status )));
423
+ } else {
424
+ /* We have enough space for the object, build it */
425
+
426
+ status =
427
+ acpi_ut_copy_iobject_to_eobject (info -> return_object ,
428
+ return_buffer );
432
429
}
433
430
}
434
431
432
+ cleanup_return_object :
433
+
435
434
if (info -> return_object ) {
436
435
/*
437
436
* Delete the internal return object. NOTE: Interpreter must be
0 commit comments