diff --git a/system/bta/hf_client/bta_hf_client_at.cc b/system/bta/hf_client/bta_hf_client_at.cc
index e6a7923e6d7b1616c75ff5b60ac0c8bc6983bfb8..8bd55ed4267703416d3529bcb1aec640119550d7 100644
--- a/system/bta/hf_client/bta_hf_client_at.cc
+++ b/system/bta/hf_client/bta_hf_client_at.cc
@@ -1246,7 +1246,7 @@ static char* bta_hf_client_parse_clcc(tBTA_HF_CLIENT_CB* client_cb,
 
     if (res2 == 0) {
       res2 = sscanf(buffer, ",\"\",%hu%n", &type, &offset);
-      if (res < 0) return NULL;
+      if (res2 < 0) return NULL;
 
       /* numstr is not matched in second attempt, correct this */
       res2++;