From c6bf2f291ddca5e8807268f89733e9f6637b4303 Mon Sep 17 00:00:00 2001 From: Alex Ray Date: Tue, 28 May 2013 15:52:04 -0700 Subject: modules: camera: fix compiler warnings Change-Id: Id1aa624d377776a7e37b52978664d30c927595be --- modules/camera/CameraHAL.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/camera/CameraHAL.cpp') diff --git a/modules/camera/CameraHAL.cpp b/modules/camera/CameraHAL.cpp index 0d8164c..dfbbe4c 100644 --- a/modules/camera/CameraHAL.cpp +++ b/modules/camera/CameraHAL.cpp @@ -92,6 +92,10 @@ int CameraHAL::open(const hw_module_t* mod, const char* name, hw_device_t** dev) char *nameEnd; ALOGV("%s: module=%p, name=%s, device=%p", __func__, mod, name, dev); + if (*name == '\0') { + ALOGE("%s: Invalid camera id name is NULL", __func__); + return -EINVAL; + } id = strtol(name, &nameEnd, 10); if (*nameEnd != '\0') { ALOGE("%s: Invalid camera id name %s", __func__, name); -- cgit v1.1