@@ -285,7 +285,7 @@ static int _get_dump(struct iokit_data *priv, char *fname)
285285 long long data_length , buf_offset ;
286286 int dumpfd = -1 ;
287287 int transfer_size , num_transfers , excess_transfer ;
288- int bytes ;
288+ int i , bytes ;
289289 unsigned char cap_buf [DUMP_HEADER_SIZE ];
290290 unsigned char * dump_buf ;
291291 int buf_id ;
@@ -331,11 +331,14 @@ static int _get_dump(struct iokit_data *priv, char *fname)
331331
332332 /* start to transfer data */
333333 buf_offset = 0 ;
334+ i = 0 ;
334335 ltfsmsg (LTFS_DEBUG , 30859D );
335336 while (num_transfers )
336337 {
337338 int length ;
338339
340+ i ++ ;
341+
339342 /* Allocation Length is transfer_size or excess_transfer*/
340343 if (excess_transfer && num_transfers == 1 )
341344 length = excess_transfer ;
@@ -3409,9 +3412,7 @@ int iokit_set_xattr(void *device, const char *name, const char *buf, size_t size
34093412 free (null_terminated );
34103413
34113414 ltfs_profiler_add_entry (priv -> profiler , NULL , TAPEBEND_REQ_EXIT (REQ_TC_SETXATTR ));
3412- /* ret is DEVICE_GOOD when one of the vendor attributes matched above;
3413- * returning the hardcoded failure reported success as an error. */
3414- return ret ;
3415+ return - LTFS_NO_XATTR ;
34153416}
34163417
34173418#define BLOCKLEN_DATA_SIZE 6
@@ -3628,7 +3629,7 @@ static const char *_generate_product_name(const char *product_id)
36283629
36293630int iokit_get_device_list (struct tc_drive_info * buf , int count )
36303631{
3631- int i ;
3632+ int i , ret ;
36323633 int found = 0 ;
36333634 int32_t devs = iokit_get_ssc_device_count ();
36343635 int drive_type ;
@@ -3645,7 +3646,10 @@ int iokit_get_device_list(struct tc_drive_info *buf, int count)
36453646 if ( devs > 0 ) {
36463647 for (i = 0 ; i < devs ; i ++ ) {
36473648 if (iokit_find_ssc_device (iokit_device , i ) != 0 )
3649+ {
3650+ ret = - EDEV_DEVICE_UNOPENABLE ;
36483651 continue ;
3652+ }
36493653 drive_type = iokit_get_drive_identifier (iokit_device , & identifier );
36503654 if (!drive_type ) {
36513655 if (found < count && buf ) {
@@ -3661,7 +3665,7 @@ int iokit_get_device_list(struct tc_drive_info *buf, int count)
36613665 }
36623666 found ++ ;
36633667 }
3664- iokit_free_device (iokit_device );
3668+ ret = iokit_free_device (iokit_device );
36653669 }
36663670 }
36673671
0 commit comments