mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
cdba-server: Don't close what wasn't opened
In the case that we quit without actually having opened a device this would dereference a NULL pointer, so check the device before doing so. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
@@ -413,7 +413,8 @@ int main(int argc, char **argv)
|
||||
|
||||
done:
|
||||
|
||||
device_close(selected_device);
|
||||
if (selected_device)
|
||||
device_close(selected_device);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user