Lines Matching refs:NULL
45 static char *g_fscryptPolicy = NULL;
64 BEGET_CHECK_RETURN_VALUE(flagBuffer != NULL && *flagBuffer != '\0', 0); // No valid flags. in ConvertFlags()
69 BEGET_CHECK_RETURN_VALUE(vector != NULL && flagCount != 0, 0); in ConvertFlags()
83 if (fstab == NULL || item == NULL) { in AddToFstab()
86 if (fstab->tail == NULL) { in AddToFstab()
97 if (item != NULL) { in ReleaseFstabItem()
98 if (item->deviceName != NULL) { in ReleaseFstabItem()
100 item->deviceName = NULL; in ReleaseFstabItem()
103 if (item->mountPoint != NULL) { in ReleaseFstabItem()
105 item->mountPoint = NULL; in ReleaseFstabItem()
108 if (item->fsType != NULL) { in ReleaseFstabItem()
110 item->fsType = NULL; in ReleaseFstabItem()
113 if (item->mountOptions != NULL) { in ReleaseFstabItem()
115 item->mountOptions = NULL; in ReleaseFstabItem()
124 if (fstab != NULL) { in ReleaseFstab()
126 while (item != NULL) { in ReleaseFstab()
131 fstab->head = fstab->tail = NULL; in ReleaseFstab()
133 fstab = NULL; in ReleaseFstab()
139 BEGET_CHECK_RETURN_VALUE(str != NULL && fstab != NULL, -1); in ParseFstabPerLine()
140 char *rest = NULL; in ParseFstabPerLine()
141 FstabItem *item = NULL; in ParseFstabPerLine()
142 char *p = NULL; in ParseFstabPerLine()
143 …BEGET_ERROR_CHECK(separator != NULL && *separator != '\0', return -1, "Invalid separator for parsi… in ParseFstabPerLine()
145 if ((item = (FstabItem *)calloc(1, sizeof(FstabItem))) == NULL) { in ParseFstabPerLine()
152 …BEGET_ERROR_CHECK((p = strtok_r(str, separator, &rest)) != NULL, break, "Failed to parse block dev… in ParseFstabPerLine()
154 BEGET_ERROR_CHECK(item->deviceName != NULL, break, "strdup deviceName failed."); in ParseFstabPerLine()
156 …BEGET_ERROR_CHECK((p = strtok_r(NULL, separator, &rest)) != NULL, break, "Failed to parse mount po… in ParseFstabPerLine()
158 BEGET_ERROR_CHECK(item->mountPoint != NULL, break, "strdup mountPoint failed."); in ParseFstabPerLine()
160 …BEGET_ERROR_CHECK((p = strtok_r(NULL, separator, &rest)) != NULL, break, "Failed to parse fs type.… in ParseFstabPerLine()
162 BEGET_ERROR_CHECK(item->fsType != NULL, break, "strdup fsType failed."); in ParseFstabPerLine()
164 …BEGET_ERROR_CHECK((p = strtok_r(NULL, separator, &rest)) != NULL, break, "Failed to parse mount op… in ParseFstabPerLine()
166 BEGET_ERROR_CHECK(item->mountOptions != NULL, break, "strdup mountOptions failed."); in ParseFstabPerLine()
168 if ((p = strtok_r(NULL, separator, &rest)) == NULL) { in ParseFstabPerLine()
183 item = NULL; in ParseFstabPerLine()
189 char *line = NULL; in ReadFstabFromFile()
192 Fstab *fstab = NULL; in ReadFstabFromFile()
194 FILE *fp = NULL; in ReadFstabFromFile()
196 if (realPath != NULL) { in ReadFstabFromFile()
202 BEGET_ERROR_CHECK(fp != NULL, return NULL, "Open %s failed, err = %d", file, errno); in ReadFstabFromFile()
204 if ((fstab = (Fstab *)calloc(1, sizeof(Fstab))) == NULL) { in ReadFstabFromFile()
207 fp = NULL; in ReadFstabFromFile()
208 return NULL; in ReadFstabFromFile()
214 char *p = NULL; in ReadFstabFromFile()
239 if (line != NULL) { in ReadFstabFromFile()
243 fp = NULL; in ReadFstabFromFile()
249 FstabItem *item = NULL; in FindFstabItemForMountPoint()
250 if (mp != NULL) { in FindFstabItemForMountPoint()
251 for (item = fstab.head; item != NULL; item = item->next) { in FindFstabItemForMountPoint()
252 if ((item->mountPoint != NULL) && (strcmp(item->mountPoint, mp) == 0)) { in FindFstabItemForMountPoint()
262 FstabItem *item = NULL; in FindFstabItemForPath()
264 if (path == NULL || *path != '/') { in FindFstabItemForPath()
265 return NULL; in FindFstabItemForPath()
269 char *dir = NULL; in FindFstabItemForPath()
272 return NULL; in FindFstabItemForPath()
278 if (item != NULL) { in FindFstabItemForPath()
283 if (dir == NULL || strcmp(dir, "/") == 0) { in FindFstabItemForPath()
295 return NULL; in GetFstabFile()
302 return NULL; in GetFstabFile()
306 return NULL; in GetFstabFile()
315 if (fstab == NULL || mountPoint == NULL || *mountPoint == '\0' || deviceName == NULL) { in GetBlockDeviceByMountPoint()
319 if (item == NULL) { in GetBlockDeviceByMountPoint()
332 for (FstabItem *item = fstab->head; item != NULL; item = item->next) { in GetBlockDeviceByName()
333 if (strstr(item->deviceName, deviceName) != NULL) { in GetBlockDeviceByName()
363 if (str != NULL) { in IsDefaultMountFlags()
377 if (str != NULL) { in ParseDefaultMountFlag()
402 if (option == NULL) { in StoreFscryptPolicy()
405 if (g_fscryptPolicy != NULL) { in StoreFscryptPolicy()
410 if (g_fscryptPolicy == NULL) { in StoreFscryptPolicy()
420 if (buf == NULL || g_fscryptPolicy == NULL) { in LoadFscryptPolicy()
433 g_fscryptPolicy = NULL; in LoadFscryptPolicy()
443 BEGET_CHECK_RETURN_VALUE(mountFlag != NULL && fsSpecificData != NULL, 0); in GetMountFlags()
454 if (flagsVector == NULL || flagCount == 0) { in GetMountFlags()
490 BEGET_CHECK_RETURN_VALUE(partName != NULL && path != NULL, -1); in GetBlockDevicePath()
492 if (fstab == NULL) { in GetBlockDevicePath()
495 BEGET_CHECK_RETURN_VALUE(fstabFile != NULL, -1); in GetBlockDevicePath()
498 BEGET_CHECK_RETURN_VALUE(fstab != NULL, -1); in GetBlockDevicePath()
521 BEGET_CHECK(!(item == NULL || *item == '\0' || fstab == NULL), return -1); in ParseRequiredMountInfo()
523 char *p = NULL; in ParseRequiredMountInfo()
524 if ((p = strstr(item, "=")) != NULL) { in ParseRequiredMountInfo()
526 BEGET_CHECK(!(q == NULL || *q == '\0' || (p - q) <= 0), return -1); in ParseRequiredMountInfo()
543 Fstab *fstab = NULL; in LoadFstabFromCommandLine()
547 …BEGET_ERROR_CHECK(cmdline != NULL, return NULL, "Read from \'%s\' failed, err = %d", BOOT_CMD_LINE… in LoadFstabFromCommandLine()
550 BEGET_ERROR_CHECK(fstab != NULL, free(cmdline); return NULL, in LoadFstabFromCommandLine()
556 if (token == NULL) { in LoadFstabFromCommandLine()
592 fstab = NULL; in LoadFstabFromCommandLine()