]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - lib/dhry_1.c
ARM: tegra: Reuse I2C3 for NVEC
[thirdparty/linux.git] / lib / dhry_1.c
index 83247106824cc7f4e6a6aef5029781ca28362cb8..08edbbb19f573ff73f3fb339591533f8c707716b 100644 (file)
@@ -139,8 +139,15 @@ int dhry(int n)
 
        /* Initializations */
 
-       Next_Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_KERNEL);
-       Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_KERNEL);
+       Next_Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC);
+       if (!Next_Ptr_Glob)
+               return -ENOMEM;
+
+       Ptr_Glob = (Rec_Pointer)kzalloc(sizeof(Rec_Type), GFP_ATOMIC);
+       if (!Ptr_Glob) {
+               kfree(Next_Ptr_Glob);
+               return -ENOMEM;
+       }
 
        Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
        Ptr_Glob->Discr = Ident_1;