Check if creating the dictionary worked before accessing it, not afterwards.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28860 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ee3fc61a48
commit
084d57cef4
1 changed files with 2 additions and 3 deletions
|
@ -167,13 +167,12 @@ int ipod_scsi_inquiry(struct ipod_t* ipod, int page_code,
|
|||
/* set value to match. In case of the Ipod this is "iPodUserClientDevice". */
|
||||
CFMutableDictionaryRef sub_dict;
|
||||
sub_dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);
|
||||
if(sub_dict == NULL)
|
||||
return -1;
|
||||
CFDictionarySetValue(sub_dict, CFSTR(kIOPropertySCSITaskDeviceCategory),
|
||||
CFSTR("iPodUserClientDevice"));
|
||||
CFDictionarySetValue(match_dict, CFSTR(kIOPropertyMatchKey), sub_dict);
|
||||
|
||||
if(sub_dict == NULL)
|
||||
return -1;
|
||||
|
||||
/* get an iterator for searching for the service. */
|
||||
kern_return_t kr;
|
||||
io_iterator_t iterator = IO_OBJECT_NULL;
|
||||
|
|
Loading…
Reference in a new issue