mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 13:04:29 +00:00
Fail gracefully if unable to open the opencl files.
This commit is contained in:
parent
1c5ab073ec
commit
48180b697b
3
ocl.c
3
ocl.c
@ -367,6 +367,9 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
|||||||
char *source, *rawsource = file_contents(filename, &pl);
|
char *source, *rawsource = file_contents(filename, &pl);
|
||||||
size_t sourceSize[] = {(size_t)pl};
|
size_t sourceSize[] = {(size_t)pl};
|
||||||
|
|
||||||
|
if (!rawsource)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
source = malloc(pl);
|
source = malloc(pl);
|
||||||
if (!source) {
|
if (!source) {
|
||||||
applog(LOG_ERR, "Unable to malloc source");
|
applog(LOG_ERR, "Unable to malloc source");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user