Skip to content

Commit

Permalink
opencl: Fail gracefully if unsupported mining algo gets into opencl_s…
Browse files Browse the repository at this point in the history
…canhash_get_kernel
  • Loading branch information
luke-jr committed Nov 7, 2014
1 parent 0160ffd commit afa1df6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion driver-opencl.c
Expand Up @@ -1706,7 +1706,7 @@ extern int opt_dynamic_interval;
const struct opencl_kernel_info *opencl_scanhash_get_kernel(struct cgpu_info * const cgpu, _clState * const clState, const struct mining_algorithm * const malgo)
{
struct opencl_device_data * const data = cgpu->device_data;
struct opencl_kernel_info *kernelinfo;
struct opencl_kernel_info *kernelinfo = NULL;
char *kernel_file;
switch (malgo->algo)
{
Expand Down Expand Up @@ -1755,6 +1755,8 @@ const struct opencl_kernel_info *opencl_scanhash_get_kernel(struct cgpu_info * c
break;
#endif
}
if (!kernelinfo)
applogr(NULL, LOG_ERR, "%s: Unsupported mining algorithm", cgpu->dev_repr);
if (!kernelinfo->loaded)
{
if (!opencl_load_kernel(cgpu, clState, cgpu->name, kernelinfo, kernel_file, malgo))
Expand Down

0 comments on commit afa1df6

Please sign in to comment.